Create Integrations
Define integrations to specify the HTTP requests required to retrieve the raw feed from the OEM, including the polling interval and schema version.
Create an integration using the Integrations API.
Create Integration with Basic Authentication
Here’s an example of how to format the OEM details in request body for an integration that includes a feed endpoint which authenticates with Basic Authentication
Sample Request
"OemInfo": [ { "UrlType": "Feed", "Url": "https://oem.com/aemp", "HttpMethod": "GET", "Headers": { "Authorization": "Basic <base64encoded>" }, "Sequence": 1 }]!!!Note
* For Basic Authentication, the UrlType should be Feed.
* Replace the <base64encoded> with the credentials base64 encoded in the format clientId:clientsecret
Create Integration with Client Credentials Authentication
Here’s an example of how to format the OEM details in request body for an integration that includes a feed endpoint which authenticates with Oauth Client Credentials Grant type
Sample Request
"OemInfo": [ { "UrlType": "Token", "Url": "https://oem.com/token", "HttpMethod": "POST", "Headers": { "Authorization": "Basic <base64encoded>", "Content-Type": "application/x-www-form-urlencoded" }, "Body": { "grant_type": "client_credentials" }, "Sequence": 1 }, { "UrlType": "Feed", "Url": "https://oem.com/aemp", "HttpMethod": "GET", "Headers": { "Authorization": "Bearer {$.Response[1].Body.access_token}" }, "Sequence": 2 }]!!!Note
* For OAuth2 Authentication (using client credentials), the UrlType should be Token and Feed.
* Replace the <base64encoded> with the credentials encoded in the format clientId:clientsecret
* The placeholder { $.Response[1].Body.access_token } indicates that the Authorization for the second element depends on the response from the first element. Consider the below example is the response of the first element request. Response[1] refers to the response from the first request in the sequence (the token request). Body.access_token points to the access_token field in the body of the response.Actual value of access_token (“abcdef1234567890” in this example) will be used in the Authorization header of the second request.
{ "access_token": "abcdef1234567890", "token_type": "Bearer", "expires_in": 3600 }
Create Integration with Authorization Code Authentication
Here’s an example of how to format the OEM details in request body for an integration that includes a feed endpoint which authenticates with Oauth Authorization Code Grant type
Sample Request
"OemInfo": [ { "UrlType": "Token", "Url": "https://oem.com/v1/token", "HttpMethod": "POST",
"Headers": { "Authorization": "Basic <base64encoded>", "Content-Type": "application/x-www-form-urlencoded" }, "QueryParams": { "grant_type": "authorization_code", "code": "fGPGXLf6EEE8-VVih0xLiKNAnO6WViVekoRyLYwzNp0", "redirect_uri": "https://developer.deere.com/getToken" }, "Sequence": 1 }, { "UrlType": "RefreshToken", "Url": "https://oem.com/oauth2/aus78tnlaysMraFhC1t7/v1/token", "HttpMethod": "POST", "Headers": { "Authorization": "Basic <base64encoded>", "Content-Type": "application/x-www-form-urlencoded" }, "QueryParams": { "grant_type": "refresh_token", "refresh_token": "{$.refresh_token}" }, "Sequence": 2 }, { "UrlType": "Feed", "Url": "https://oem.com/Fleet/1", "HttpMethod": "GET", "Headers": { "Authorization": "Bearer {$.Response[2].Body.access_token}", "Accept": "application/xml" }, "Sequence": 3 }]!!!Note
* For OAuth2 Authentication (using the grant_type authorization_code), the format should follow the structure given above.
* UrlType should be Token, RefreshToken and Feed.
* Replace the <base64encoded> with the credentials encoded in the format clientId:clientsecret
* In the second element, where the UrlType is RefreshToken, the { $.refresh_token } is retrieved from the response of the first element, which uses the grant_type authorization_code.
* The placeholder { $.Response[2].Body.access_token } indicates that the authorization for the third element depends on the response from the second element.