Get Token
Overview
The access token serves as the authentication credential for all Duix interactive service APIs.Each HTTP request must include the token in the Authorization Header.
How to Generate an Access Token
Prerequisites
Before generating a token, ensure you have the following:- appId — The unique identifier of your application.
- appKey — The secret key associated with your application.
Steps to Generate a Token
- Generate a JWT signature using your
appIdandappKey. - Pass the generated signature to the H5 SDK
initmethod.
Signature Generation
The signature is implemented using JWT (JSON Web Token).Use the following parameters and example code to generate a valid signature.
Parameters
| Name | Type | Description | Example |
|---|---|---|---|
| appId | string | Application identifier obtained after registration | xxxxxxx |
| appKey | string | Application secret key obtained after registration | xxxxxxx |
| sigExp | integer | Signature validity period (in seconds) | 1800 |
Example: Java Implementation
Add Maven Dependency
sign).