HyperTrack API Basics

The HyperTrack API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. To make API calls, you can use our helper libraries or use any HTTP client.

We use built-in HTTP features, like HTTP authentication and HTTP verbs, which can be understood by off-the-shelf HTTP clients, and we support cross-origin resource sharing to allow you to interact securely with our API from a client-side web application (though you should remember that you should never expose your secret API key in any public website’s client-side code).

JSON will be returned in all responses from the API, including errors (though if you’re using API bindings, we will convert the response to the appropriate language-specific object).

[info] Postman collection

Trying out the APIs? You can use our Postman collection to try out the APIs. Set your key as a global variable to simplify authentication. You can also view our Postman tutorial and video for a quick walkthrough.

Run in Postman

Helper libraries

To make your server-side integration easier, you can use one of our following helpers libraries. These can be directly imported to your application. If your language of choice is not listed, you can use any HTTP requests library to make API calls.

Python

The hypertrack-python library can be installed using pip.

$ pip install hypertrack
import hypertrack
# Initialize the library with the secret token
hypertrack.secret_key = 'YOUR_SK_TOKEN'

Java

The hypertrack-java library can be installed using maven.

<dependency>
  <groupId>io.hypertrack</groupId>
  <artifactId>hypertrack-java</artifactId>
  <version>1.0.0</version>
</dependency>
import io.hypertrack.net.HyperTrackClient;

public class SimpleExample {
    public static void main( String[] args ) throws Exception
    {
        /* Create client instance with secret token. */
        HyperTrackClient client = new HyperTrackClient("YOUR_SK_TOKEN");
    }
}

Node.js

The hypertrack-node library can be installed using npm.

$ npm install hypertrack
var hypertrack = require('hypertrack')('<YOUR_SK_TOKEN>');

Ruby

The hypertrack-ruby library can be installed using gem.

$ gem install hypertrack
require 'hypertrack'
HyperTrack.secret_key = "<YOUR_SK_TOKEN>"

HTTP request headers

In case you are not using a helper library, you will need to add these keys to your request headers.

Content type

While sending POST requests with a JSON body, remember to add the Content-Type header to define input format.

Content-Type: application/json

Authorization

The API follows HTTP basic auth to authenticate API calls with a token. Every API call needs to have the Authorization key sent in the request header with the token, as shown below.

Authorization: token sk_1234567890abcde

Was this helpful? Yes, thanks! Not really

results matching ""

    No results matching ""