Generate Token
Function Description
Generate authentication tokens for communication between the device and the third-party server.
If the integration partner has no requirements for this, this step can be omitted, and the corresponding third-party server will not verify and restrict device requests.
Request Description
Request Method: GET
Request URL: /tokens
Parameter Format:Query String Parameters/ URL parameters
Request Parameters
| Field | Type | Description |
|---|---|---|
| sn | string | Device SN |
| secret | string | Secret |
Response Result
{
"code": 0,
"message": "SUCCESS",
"result": {
"token": ".eyJpZCI6MTMzOTcsInNuIjoiMTEwNDIyMTkwNzAwNyJ9.nW2l5fFz64pJdVNXhWr0VOGREYH2xNxUwv7byH3-k1k"
}
}
Response Parameters
| Field | Type | Description |
|---|---|---|
| token | string | Token value |
Update Rules
- The token needs to be updated every half an hour.
- If the HTTP status code returns
401, it will trigger a request for an update.