Skip to main content
Skip table of contents

Obtain device token

This endpoint can be used to acquire or refresh a device token. The initial acquisition requires the device_code parameter to be provided. The refresh operation requires a refresh token to be provided.

Endpoint is available at /token relative path. This endpoint requires a signature header to be always present.

Initial device token acquisition

Parameters:

  • client_id: unique client ID
  • client_secret: API key
  • grant_type: device_code
  • device_code: the device code acquired via registration call

Return value:
The Error object if error occurred, otherwise DeviceToken JSON object which has the following structure:

CODE
{
    "token_type": "Bearer",
    "expires_in": NNN,
    "access_token": "xxx",
    "refresh_token": "yyy"
}

Where token_type is always “Bearer”, expires_in is an access token expiration time in seconds, access_token is an access token which must be provided in the call to the public API login function, refresh_token is the token used to refresh the device token.

Device token refresh

Parameters:

  • client_id: unique client ID
  • client_secret: API key
  • grant_type: refresh_token
  • refresh_token: the refresh token

Return value:
The Error object if error occurred, otherwise a new DeviceToken JSON object. Refresh token may only be used once.

If authorization_pending error is returned the client should keep polling the endpoint until the token is acquired or some other error is returned.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.