From d87c9e215ee8f315be0d5c95e1de789bf99804d1 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Wed, 5 Jun 2024 14:56:29 +0300 Subject: [PATCH] DTF DBS base URL change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ref](https://digiproduct-squad.monday.com/boards/1332876835/pulses/6772865429) DTF APIs now have new application specific vanity URLs as noted below. The current URLs will not work after July 2024, so requesting you to update DTF integrations with new URLs before June 30th, 2024. Note that this change is limited to base URL update only – all the API calls will work as is after the URL change. There is no change in any of the file formats, supported file types or schedules with this update. This change will allow us to better support future dealer integration needs with no additional changes on your side. --- src/ApiClientConfig.php | 6 +++--- tests/ApiClientConfigTest.php | 30 +++++++++++++++--------------- tests/ApiClientTest.php | 10 +++++----- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/ApiClientConfig.php b/src/ApiClientConfig.php index baf8435..cc87b46 100644 --- a/src/ApiClientConfig.php +++ b/src/ApiClientConfig.php @@ -320,11 +320,11 @@ public static function getApiBasePathUrl(string $environment): string { switch ($environment) { case 'qual': - return 'https://servicesextqual.tal.deere.com/dtfapi'; + return 'https://dtfapiqual.deere.com'; case 'cert': - return 'https://servicesextcert.deere.com/dtfapi'; + return 'https://dtfapicert.deere.com'; case 'prod': - return 'https://servicesext.deere.com/dtfapi'; + return 'https://dtfapi.deere.com'; default: throw new \InvalidArgumentException('DTF DBS API Client: Unknown environment to get API base path'); } diff --git a/tests/ApiClientConfigTest.php b/tests/ApiClientConfigTest.php index 00616f7..8db102a 100644 --- a/tests/ApiClientConfigTest.php +++ b/tests/ApiClientConfigTest.php @@ -173,15 +173,15 @@ public function provideBasePathUrls(): array return [ 'qual' => [ 'qual', - 'https://servicesextqual.tal.deere.com/dtfapi', + 'https://dtfapiqual.deere.com', ], 'cert' => [ 'cert', - 'https://servicesextcert.deere.com/dtfapi', + 'https://dtfapicert.deere.com', ], 'prod' => [ 'prod', - 'https://servicesext.deere.com/dtfapi', + 'https://dtfapi.deere.com', ], ]; } @@ -307,7 +307,7 @@ public function getFileUploadRequests(): array null, null, (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('prod')) - ->withPath('/dtfapi/dbs/dealer/test01/files'), + ->withPath('/dbs/dealer/test01/files'), "Bearer {$accessToken}", $guzzleFactory->createStreamFromFile(__DIR__ . '/samplecommonfile.txt'), ], @@ -317,7 +317,7 @@ public function getFileUploadRequests(): array null, null, (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('prod')) - ->withPath('/dtfapi/dbs/dealer/test01/files'), + ->withPath('/dbs/dealer/test01/files'), "Bearer {$accessToken}", $guzzleFactory->createStreamFromFile(__DIR__ . '/samplecommonfile.txt'), ], @@ -327,7 +327,7 @@ public function getFileUploadRequests(): array null, null, (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('prod')) - ->withPath('/dtfapi/dbs/dealer/test01/files'), + ->withPath('/dbs/dealer/test01/files'), "Bearer {$accessToken}", $guzzleFactory->createStreamFromFile(__DIR__ . '/samplecommonfile.txt'), ], @@ -337,7 +337,7 @@ public function getFileUploadRequests(): array 'Screen Recording at 2022-04-01 12:34:56.mp4', null, (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('prod')) - ->withPath('/dtfapi/dbs/dealer/test01/files') + ->withPath('/dbs/dealer/test01/files') ->withQuery(\http_build_query(['fileName' => 'Screen Recording at 2022-04-01 12:34:56.mp4'])), "Bearer {$accessToken}", $guzzleFactory->createStreamFromFile(__DIR__ . '/samplecommonfile.txt'), @@ -348,7 +348,7 @@ public function getFileUploadRequests(): array null, true, (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('prod')) - ->withPath('/dtfapi/dbs/dealer/test01/files') + ->withPath('/dbs/dealer/test01/files') ->withQuery(\http_build_query(['overWrite' => 'True'])), "Bearer {$accessToken}", $guzzleFactory->createStreamFromFile(__DIR__ . '/samplecommonfile.txt'), @@ -359,7 +359,7 @@ public function getFileUploadRequests(): array 'Screen Recording at 2022-04-01 12:34:56.mp4', true, (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('prod')) - ->withPath('/dtfapi/dbs/dealer/test01/files') + ->withPath('/dbs/dealer/test01/files') ->withQuery(\http_build_query([ 'fileName' => 'Screen Recording at 2022-04-01 12:34:56.mp4', 'overWrite' => 'True' @@ -403,7 +403,7 @@ public function getFileListRequests(): array ->setEnvironment('cert') ->setAccessToken($accessToken), (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('cert')) - ->withPath('/dtfapi/dbs/dealer/test01/files'), + ->withPath('/dbs/dealer/test01/files'), "Bearer {$accessToken}", 'application/json', ], @@ -413,7 +413,7 @@ public function getFileListRequests(): array ->setEnvironment('prod') ->setAccessToken($accessToken), (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('prod')) - ->withPath('/dtfapi/dbs/dealer/06DV01/files'), + ->withPath('/dbs/dealer/06DV01/files'), "Bearer {$accessToken}", 'application/json', ], @@ -455,7 +455,7 @@ public function getFileDownloadRequests(): array ->setAccessToken($accessToken), 'samplecommonfile.txt', (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('cert')) - ->withPath('/dtfapi/dbs/dealer/test01/files/samplecommonfile.txt'), + ->withPath('/dbs/dealer/test01/files/samplecommonfile.txt'), "Bearer {$accessToken}", 'application/json', ], @@ -466,7 +466,7 @@ public function getFileDownloadRequests(): array ->setAccessToken($accessToken), 'Screen Recording at 2022-04-01 12:34:56.mp4', (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('prod')) - ->withPath('/dtfapi/dbs/dealer/06DV01/files/' . \rawurlencode('Screen Recording at 2022-04-01 12:34:56.mp4')), + ->withPath('/dbs/dealer/06DV01/files/' . \rawurlencode('Screen Recording at 2022-04-01 12:34:56.mp4')), "Bearer {$accessToken}", 'application/json', ], @@ -508,7 +508,7 @@ public function getFileDetailsRequests(): array ->setAccessToken($accessToken), 'samplecommonfile.txt', (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('cert')) - ->withPath('/dtfapi/dbs/dealer/test01/files/samplecommonfile.txt/details'), + ->withPath('/dbs/dealer/test01/files/samplecommonfile.txt/details'), "Bearer {$accessToken}", 'application/json', ], @@ -519,7 +519,7 @@ public function getFileDetailsRequests(): array ->setAccessToken($accessToken), 'Screen Recording at 2022-04-01 12:34:56.mp4', (string)$guzzleFactory->createUri(ApiClientConfig::getApiBasePathUrl('prod')) - ->withPath('/dtfapi/dbs/dealer/06DV01/files/' . \rawurlencode('Screen Recording at 2022-04-01 12:34:56.mp4')) . '/details', + ->withPath('/dbs/dealer/06DV01/files/' . \rawurlencode('Screen Recording at 2022-04-01 12:34:56.mp4')) . '/details', "Bearer {$accessToken}", 'application/json', ], diff --git a/tests/ApiClientTest.php b/tests/ApiClientTest.php index 680e2b8..4c1d5d2 100644 --- a/tests/ApiClientTest.php +++ b/tests/ApiClientTest.php @@ -570,7 +570,7 @@ protected function getFileListEmptyResponse(): ResponseInterface 'links' => [ [ 'rel' => 'self', - 'href' => 'https://servicesext.deere.com/dtfapi/dbs/dealer/test01/files' + 'href' => 'https://dtfapi.deere.com/dbs/dbs/dealer/test01/files' ] ], ])) @@ -592,7 +592,7 @@ protected function getFileListFromDocResponse(): ResponseInterface 'links' => [ [ 'rel' => 'self', - 'href' => 'https://servicesextcert.deere.com/dtfapi/dbs/dealer/06DV01/files/samplecommonfile.txt', + 'href' => 'https://dtfapicert.deere.com/dbs/dealer/06DV01/files/samplecommonfile.txt', ], ], ], @@ -600,7 +600,7 @@ protected function getFileListFromDocResponse(): ResponseInterface 'links' => [ [ 'rel' => 'self', - 'href' => 'https://servicesextcert.deere.com/dtfapi/dbs/dealer/06DV01/files' + 'href' => 'https://dtfapicert.deere.com/dbs/dealer/06DV01/files' ] ], ])) @@ -636,11 +636,11 @@ protected function getFileDetailsResponse(): ResponseInterface 'links' => [ [ 'rel' => 'download', - 'href' => 'https://servicesextcert.deere.com/dtfapi/dbs/dealer/06DV01/files/samplecommonfile.txt' + 'href' => 'https://dtfapicert.deere.com/dbs/dealer/06DV01/files/samplecommonfile.txt' ], [ 'rel' => 'self', - 'href' => 'https://servicesextcert.deere.com/dtfapi/dbs/dealer/06DV01/files/samplecommonfile.txt/details' + 'href' => 'https://dtfapicert.deere.com/dbs/dealer/06DV01/files/samplecommonfile.txt/details' ], ], ])))