Skip to main content
Introduction
Fin avatar
Written by Fin
Updated over a week ago

INTRODUCTION

Detrack’s Application Programming Interface (API) enables your application to communicate directly with Detrack to perform common tasks such as adding, editing, and deleting deliveries without the need for any manual data entry or human intervention. Our API provides an easy HTTP interface to Detrack’s functionality.

Method #1: Name/Value Pair (NVP) + JSON String

You can use a combined format of Name/Value Pair (NVP) and JSON via HTTP POST (over SSL) for a simple and secure communication between our application servers. In general, all requests should follow the signature below:

key=YOUR_API_KEY&json={}

Example (HTTP GET equivalent for illustration purpose – actual request should be HTTP POST):

https://app.detrack.com/api/v1/deliveries/view/all.json?key=YOUR_API_KEY&json={"date":"2014-02-13"}

To illustrate further, the following HTML form will post a valid API request to Detrack:

<form action="https://app.detrack.com/api/v1/deliveries/view/all.json" method="post">
    <input type="text" name="key" value="YOUR_API_KEY" />
    <textarea name="json">{"date":"2016-02-14"}</textarea>
    <input type="submit" value="Submit API Request" />
</form>

Both the key and json parameters are required fields in all requests. Your API key and request will be hidden (or encrypted) with the request made via HTTP POST over SSL. All responses are in JSON format except for file downloads.

Method #2: Custom Header + JSON Body

Alternatively, you can set your API key in a custom HTTP header and your request in a JSON body. For this to work, you will need to set the HTTP header ‘Content-Type‘ to ‘application/json‘ so that our system can detect your JSON request.

Set HTTP header ‘Content-Type‘ to ‘application/json‘.

Content-Type: application/json

Set Custom HTTP header ‘X-API-KEY‘ with your Detrack API key.

X-API-KEY: YOUR_API_KEY

Set your JSON request body.

{"date":"2016-02-14"}

Post request to remote API URL:

https://app.detrack.com/api/v1/deliveries/view/all.json

As with Method #1, the request must be made via HTTP POST over SSL. All responses are in JSON format except for file downloads.

Application Programming Interface (API) Key

To retrieve the API Key, refer to:

Transport Layer Security (TLS)

Our API will only support TLS version 1.2 and above.

Did this answer your question?