Overview
The Dealer Integration OData API provides a way to retrieve, create and update dealer integration information for a specific dealer(s). With multiple filter and expand options, this API can tell you anything from a list integrations dealer(s) are using, activate or deactivate integrations, or create a new integration on a dealer record. This document will go over how you can use the Dealer Integration OData for your specific needs.
This is an OData endpoint, and it will support the OData query language. More information about this can be found at odata.org.
Possible Response Codes
- 200 (OK). This request was successful and information will be returned.
- 401 (Unauthorized). The token is missing or invalid.
- 404 (Not Found). The dealer was not able to be found.
- 500 (Internal Server Error). The request was malformed, the dealer given in the request did not exist, or some other unspecified error occurred when attempting to retrieve dealer integration information.
Authentication
The Dealer Integration API requires authentication. The GET request will require a valid Authenticate message header with an API token. See the Aimbase Authentication Web Service Specification for more details on how to retrieve a valid API token.
Ask Narendra about the authentication and add.
Authenticate message header example:
Authenticate: Avala-Api {username}:{token}
Query Information
Endpoint for GET
GET https://{baseurl}/odata/V2/DealersIntegrations
Endpoint for CREATE
POST https://{baseurl}/odata/V2/DealersIntegrations
Endpoint for PATCH
PATCH https://{baseurl}/odata/V2/DealersIntegrations
Dealer Integration OData Data Schema
The information below will be returned in a GET, created in a POST, and the fields noted below (editable) a can be updated in a PATCH. All fields listed below can be applied as a filter. For filter formatting in OData, please reference this page and navigate to section 4.5. Filter System Query Option to see operators and examples.
Name |
Editable | Values |
Description |
Id | Integer | The Aimbase id of the integration. | |
DealerId | String | The Aimbase id for the dealer. | |
DealerIntegrationTypeId | UID | The id of the integration type. | |
Key | X | String | The integration's requirement to pass a key value when sending leads. Commonly used to route the lead to the correct dealer within the CRM Provider. |
Username | X | String |
The integration's requirement to pass a username value when sending leads. Commonly used to route the lead to the correct dealer within the CRM Provider. |
Password | X | String |
The integration's requirement to pass a password value when sending leads. Commonly used to route the lead to the correct dealer within the CRM Provider. |
IsActive | X | Boolean | If the integration is active or not. |
CreatedDate | YYYY-MM-dd ±hh:mm | The date the integration was entered. | |
UpdateDate | YYYY-MM-dd ±hh:mm | The date the integration was updated. | |
CreateAccountId | Integer | The id of the account that created the integration on the dealer record. | |
UpdateAccountId | Integer | The id of the account that created the integration on the dealer record. | |
ClientId | X | String |
The integration's requirement to pass a ClientId value when sending leads. |
ClientSecret | X | String | The integration's requirement to pass a ClientSecret value when sending leads. |
ActiveDate | YYYY-MM-dd ±hh:mm |
The date the integration was set to active. | |
IsReceivingDisposition | X | Boolean | Is disposition sending for the dealer's integration. |
DispositionDate | YYYY-MM-dd ±hh:mm |
Date the disposition was set up to start sending to Aimbase. |
Expand Options
The dealer integration type and the dealer information is not included by default, but you can expand the dealer integration object object to get dealer integration type and dealer information. When you expand, you will get additional fields related to either the dealer integration type or dealer that is tied to the specified dealer integration.
See Dealer Integration Type OData and Dealer OData documentation to see all fields that can be used for the expand option.
Sample Queries
CREATE Dealer Integration
POST https://{baseurl}/odata/V2/DealerIntegrations { 2 "DealerId": 0, 3 "DealerIntegrationTypeId": 0, 4 "Key": null, 5 "Username": null, 6 "Password": null, 7 "IsActive": false, 8 "ClientId": null, 9 "ClientSecret": null, 10 "ActiveDate": null, 11 "IsReceivingDisposition": null, 12 "DispositionDate": null, 13 "DealerIntegrationMetadatas": [ 14 { 15 "Name": "ExampleField1", 16 "Value": null, 17 }, 18 { 19 "Name": "ExampleField2", 20 "Value": null, 21 } 22 ], 23 "DealerIntegrationType": { 24 "Code": "SF" 25 }, 26 "Dealer": { 27 "ManufacturerId": 0, 28 "DealerNbr": "ABC-123" 29 } 30 }
PATCH Dealer Integration
PATCH {{BaseUrl}}/Odata/V2/DealerIntegrations(67) HTTP/1.1 Content-Type: application/json Authenticate: Avala-Api jitendran:{{token}} { "Id": 67, "Key": "key1", "Username": "int test", "Password": "int test", "IsActive": true, "ClientId": "1234", "ClientSecret": "secret", "IsReceivingDisposition":true }
GET All
GET https://{baseurl}/odata/V2/DealerIntegrations
GET by ID
GET https://{baseurl}/odata/V2/DealerIntegrations(3)
FILTER
GET https://{baseurl}/odata/V2/DealerIntegrations?$filter=IsActive eq true and DealerIntegrationTypeId eq 3
Example Response
{
"Id": 3,
"DealerId": 53,
"DealerIntegrationTypeId": 3,
"Key": "test@crmprovider.com",
"Username": "",
"Password": null,
"IsActive": true,
"CreateDate": "2015-08-11T08:15:16.987+05:30",
"UpdateDate": "2015-08-11T08:17:52.707+05:30",
"CreateAccountId": 61,
"UpdateAccountId": 61,
"ClientId": null,
"ClientSecret": null,
"ActiveDate": null,
"IsReceivingDisposition": null,
"DispositionDate": null
}