Authentication

Before you can request data from our API, you need to obtain a valid Bearer token by logging in with your username and password. We recommend creating a dedicated API user in Collactr, so you don’t need to use your personal credentials.


Obtain a bearer token

For any request made to the Collactr API you will need to supply a Bearer token. The API call below will allow you to retrieve said token by supplying your Collactr username and password in the request body, and API key in the URL.

Example request to obtain a bearer token

curl https://api.collactr.com/login/YOUR_API_KEY_HERE \
  -d '{"username":"YOUR_USERNAME", "password": "YOUR_PASSWORD"}'

Authorization header

The Bearer token needs to be appended to the Authorization header in each subsequent call made to the Collactr API. Bearer tokens are valid for 60 minutes after retrieval.

Example request with bearer token

curl https://api.collactr.com/devices/list \
  -H "Authorization: Bearer {token}"