Skip to content

Commit

Permalink
DTF DBS base URL change
Browse files Browse the repository at this point in the history
[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.
  • Loading branch information
ybelenko committed Jun 5, 2024
1 parent dc1eac8 commit d87c9e2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/ApiClientConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
30 changes: 15 additions & 15 deletions tests/ApiClientConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
];
}
Expand Down Expand Up @@ -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'),
],
Expand All @@ -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'),
],
Expand All @@ -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'),
],
Expand All @@ -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'),
Expand All @@ -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'),
Expand All @@ -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'
Expand Down Expand Up @@ -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',
],
Expand All @@ -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',
],
Expand Down Expand Up @@ -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',
],
Expand All @@ -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',
],
Expand Down Expand Up @@ -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',
],
Expand All @@ -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',
],
Expand Down
10 changes: 5 additions & 5 deletions tests/ApiClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]
],
]))
Expand All @@ -592,15 +592,15 @@ 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',
],
],
],
],
'links' => [
[
'rel' => 'self',
'href' => 'https://servicesextcert.deere.com/dtfapi/dbs/dealer/06DV01/files'
'href' => 'https://dtfapicert.deere.com/dbs/dealer/06DV01/files'
]
],
]))
Expand Down Expand Up @@ -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'
],
],
])))
Expand Down

0 comments on commit d87c9e2

Please sign in to comment.