Before you can get started using the autoZnetwork APIs, you must:

  1. Login or register for a new autoZnetwork account.
  2. Generate an API Token.
  3. Understand how to make API requests.

This topic describes how to get started using the autoZnetwork APIs.

Log in or register for an account

Before you can use any autoZnetwork APIs, you need to log in to your account or, if you don't have one, create a new one. Creating an account is easy:

  1. Go to the autoZnetwork Registration page.
  2. Enter your information and click Register for a free account.

Generating a new token

  1. Click on your avatar, and go to to account settings, from here navigate to API Tokens.
  2. Give your token a name, select the permissions you would like to allow for this individual API Token.

Requests

autoZnetwork API requests are straightforward, but there are several details to know when making requests.

Constructing a URI

autoZnetwork URIs follow a standard syntax using the format of https://api.autoznetwork.com/{API Version}/{API path}

Making the request

The following steps walk through retrieving your inventory by making a GET request to /inventory using v1 of the API.

  1. Before you make your request, confirm you have a valid API token as listed above.
  2. Make a cURL request with the API token in your header as well as the "X-AutozNetwork-Organization-Id" for any resources that require it. Almost all endpoints require the usage of this header.
CURL
 AUTOZNETWORK_TOKEN="your API token"
 AUTOZNETWORK_ORG_ID="your organization id"

 curl https://api.autoznetwork.com/v1/inventory \
   -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
   -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
   -H 'Accept: application/json'

Listing resources

CURL
 AUTOZNETWORK_TOKEN="your API token"
 AUTOZNETWORK_ORG_ID="your organization id"

 curl https://api.autoznetwork.com/v1/{RESOURCE} \
   -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
   -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
   -H 'Accept: application/json'

Get an individual resource

CURL
  AUTOZNETWORK_TOKEN="your API token"
  AUTOZNETWORK_ORG_ID="your organization id"

  curl https://api.autoznetwork.com/v1/{RESOURCE}/{RESOURCE_ID} \
    -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
    -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
    -H 'Accept: application/json'

Create a resource

CURL
  AUTOZNETWORK_TOKEN="your API token"
  AUTOZNETWORK_ORG_ID="your organization id"

  curl -X POST https://api.autoznetwork.com/v1/{RESOURCE} \
    -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
    -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
      "key": "value",
    }'

Updating a resource

CURL
  AUTOZNETWORK_TOKEN="your API token"
  AUTOZNETWORK_ORG_ID="your organization id"

  curl -X PUT https://api.autoznetwork.com/v1/{RESOURCE}/{RESOURCE_ID} \
    -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
    -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
      "key": "value",
    }'

Deleting a resource

CURL
  AUTOZNETWORK_TOKEN="your API token"
  AUTOZNETWORK_ORG_ID="your organization id"

  curl -X DELETE https://api.autoznetwork.com/v1/{RESOURCE}/{RESOURCE_ID} \
    -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
    -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
    -H 'Accept: application/json'

Response Codes

autoZnetwork API response content varies but will exclusively be returned in JSON. For the most part, the content responses can be diveded as:

Error Codes

CodeStatus NameDescription
200OKRequest has succeeded.
201CreatedRequest has succeeded and has led to the creation of a resource.

Example Response

200 OK
{
  "id": 2,
  "stock": "12345",
  "name": "2018 Ford F-150 XLT SVT Raptor 4x4",
  "lifted": false,
  "lowered": false,
  "make": "Ford",
  "model": "F-150",
  "trim": "XLT SVT Raptor 4x4",
  "body_style": "Truck",
  "created_at": "2020-07-29 16:08:30",
  "updated_at": "2020-07-29 16:08:30",
  "organization": {
      "id": 11,
      "name": "Your Dealership",
  },
}

Error Handling

When you make an API call you may receive an error message in the response. Either there is something wrong with your request or something went wrong on our end. Errors respond with an error code and possibly a JSON body that contains a more precise message code.

Error Codes

CodeStatus NameDescription
400Bad RequestCheck your request and try again.
401UnauthorizedMake sure your API Key is valid.
403ForbiddenMake sure you have the proper privileges to access the resource.
404Not FoundChange your request URL to match a valid API endpoint.
422Unprocessable EntityCheck your request and try again.
429Too Many RequestsMake sure you are not over your rate limits.
500Server ErrorTry the request again later. If the error does not resolve contact support.
503Service UnavailableWe are experiencing higher than normal levels of traffic, retry the request again.
504Gateway TimeoutA downstream API has timed out or failed to return a response, try the request again.

Example Error

403 Forbidden
"errors": {
  "code": 403,
  "messages": [
    "User does not have have access to this organization."
  ]
}

Read the API reference

When you're finished setting up and ready to go, check out the API reference documentation to view the public APIs for autoZnetwork.