Dealer OData API

Overview

The dealer OData API provides a way to retrieve dealer information. With multiple filter and expand options, this API can tell you anything from a list of dealers, to what products are assigned, to what radius the dealer has, depending on the Aimbase instance. This document will go over how you can use the OData Dealer API 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 information.

Authentication

The Dealer 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. 

Authenticate message header example:

Authenticate: Avala-Api {username}:{token}

Query Information

Endpoint 

GET https://{baseurl}/odata/V2/Dealers


Get By ID

You can use a valid dealer ID from Aimbase to refine your GET to a single result based on ID. An example of how this looks is below, but it essentially inputs the ID in parenthesis directly after the base URL. 

GET https://{baseurl}/odata/V2/Dealers({DealerID})

Filter Options

Name

Values

Description

Name Valid Dealer Name from Aimbase The dealer name is what the dealer is named within Aimbase and can be used as a filter.
DealerTypeId S : Standard
D : Default
The standard dealer type ID's are listed in the Values, however, your install may have some custom dealer types.
ManufacturerId Int The valid Aimbase ID for the Manufacturer.
MfgDealerNbr String The manufacturer dealer number is the defined manufacturer dealer number from Aimbase.
MfgDealerSubNbr String If applicable for your install, you can use the manufacturer dealer sub number as a filter.
DealerNbr String The dealer number is used to identify a dealer.
Contact String The contact can filter by the primary contact identified on the dealer's record.
ContactPreferenceId Int The preference defined for the primary contact.
EMail String The primary contact email that is defined on the dealer.
EmailCC String The email CC that is defined on the dealer.
WebsiteUrl String The website defined on the dealer.
Address1 String The Address 1 field on the dealer.
Address2 String The Address 2 field on the dealer.
City String The City on the dealer.
State String The State on the dealer.
PostalCode String The postal code for the dealer.
County String The county for the dealer.
Country String The country for the dealer.
CountryCode ISO 3166-1 alpha-2 Country code for the dealer using ISO 3166 alpha-2.
Phone String The phone for the dealer.
IsActive Boolean Defines if the dealer is active or not.
CreateDate yyyy-MM-ddThh:mm:ssZ Filters by CreateDate
UpdateDate yyyy-MM-ddThh:mm:ssZ Filters by Update Date

For filter formatting in OData, please reference this page and navigate to section 4.5. Filter System Query Option to see operators and examples.

Expand Options

Name

Description

Products
Expands the products that are assigned to the dealers.
BrandsInDealers Expands the brands that are assigned to the dealers along with the radius. 

Sample Queries

Get all dealers

GET https://rollickqa.aimbase.com/odata/V2/Dealers
Content-Type: application/json
Authenticate: Avala-Api {username}:{token}

Get dealer with ID of 1

GET https://rollickqa.aimbase.com/odata/V2/Dealers(1)
Content-Type: application/json
Authenticate: Avala-Api {username}:{token}

Get dealers that have a contact that starts with "Man"

GET https://rollickqa.aimbase.com/odata/V2/Dealers?$filter=startswith(Contact, 'Man') eq true
Content-Type: application/json
Authenticate: Avala-Api {username}:{token}

Get dealer with dealer number of "Default" and expand the Brands In Dealers and Products

GET https://rollickqa.aimbase.com/odata/V2/Dealers?$filter=DealerNbr eq 'Default'&$expand=BrandsInDealers,Products
Content-Type: application/json
Authenticate: Avala-Api {username}:{token}