Generate Admin Api Token

Overview

To manage sub-accounts, an Admin Token is required. This token is obtained by calling the authentication endpoint with the API key and signature.


Authentication Endpoint - URL

  • Release Candidate (RC): https://sdk-mobile-api-rc.truvideo.com

  • Production: https://sdk-mobile-api.truvideo.com

CURL Example

HTTP Method - POST

Headers

  • x-authentication-api-key: {APIKEY} (Admin key provided by the Truvideo team)

  • x-authentication-signature: {SIGNATURE} (Generated using the secret key)

  • x-multitenant-external-id: {EXTERNAL-ID} (External ID for the sub-account, configured by the Partner. Required for multi-tenant purposes)

  • Content-Type: application/json

Request Body

{
    "timestamp": {TIMESTAMP}
}

Parameters

Parameter

Description

BASE-URL

Base URL of the endpoint.

APIKEY

Admin key provided by the Truvideo team.

EXTERNAL-ID

External ID for the sub-account. Configured by the Partner. Required for multi-tenancy.

SIGNATURE

Signature generated using the secret key (see below for generation details).

TIMESTAMP

Long timestamp in milliseconds. Must not be older than 30 minutes.

Curl Example

Response

The response will contain the accessToken field, which is used in subsequent configuration requests.

Example Response

Signature Generation

To generate the signature, follow these steps:

Step 1: Generate the Body

The body structure should be:

Step 2: Minify the Body

Remove all spaces (whitespace, tabs, etc.) and respect the structure in which the data is sent. For example:

Step 3: Create the Signature

Use the body and the secret key to generate the signature using SHA-256 in hexadecimal format. Below is an example:

For generating signature you can refer - https://www.devglan.com/online-tools/hmac-sha256-online

Notes

  • Ensure the timestamp is in milliseconds and is within the allowable time range (not older than 30 minutes).

  • Always use the exact attribute order as shown in the body example.


Usage

Use the accessToken returned in the response for subsequent configuration or API requests for managing sub-accounts.

For further assistance, please contact the Truvideo support team.

Last updated