REST APIs are authenticated using Basic Token Authentication. These tokens grant full access to user’s account and should be kept secret.

These tokens are not meant to be embedded in client applications, and only be used for User Authorization on Skylark’s Platform. Clients should use API Keys for REST Services and WebSocketTokens for WebSocket Services

Obtaining a REST Auth Token

REST Authentication Tokens are 20 byte long and can be obtained using the Login API.

URL Endpoint: https://api.skylarklabs.ai/login
FormData:-

username: <account_username>
password: <account_password>

Sample Response:-

{
    "token": "fa15bd0147b7d961814e40d40fc68937cbe329be"
}
CODE



Using a REST Auth Token

A REST authentication token is to be passed via the Authorization headers when making a request.

Authorization: token <20_byte_token_key>

Note that the token prefix is important.

In the below example, see how we use the auth token to make a REST call to the web-socket-token API. Note the Headers field.