accessToken (accessToken - Get Administrator Token - Imou Open Platform)
accessToken: accessToken - Get Administrator Token - Imou Open Platform
Function details
Obtain the accessToken according to the administrator account appId and appSecret. The appId and appSecret can be found in the console-my application-application information.
Note: The obtained accessToken is valid for 3 days. Please obtain it again when it is about to expire or the interface error TK1002 is reported. Each accessToken has an independent 3-day life cycle. Please do not call frequently to avoid occupying too many interface calls.
Device message callbacks use the same administrator token with Push configuration. See Receive device messages.
v2 capability APIs use the same administrator or sub-account
accessToken; see Capability usage.
Request address
https://openapi-[DataCenter].easy4ip.com/openapi/accessToken
Request format
HTTP POST. JSON body layout: Request conventions. Sign with Signature.
Incoming parameter description
No parameters are passed in, and the params value can be an empty map collection
Sample input
{
"system":{
"ver":"1.0",
"appId":"lcdxxxxxxxxx",
"sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
"time":1599013514,
"nonce":"fbf19fc6-17a1-4f73-a967-75eadbc805a2"
},
"id":"98a7a257-c4e4-4db3-a2d3-d97a3836b87c",
"params":{
}
}
Return data field description
| Field name | Field type | Field description |
|---|---|---|
| accessToken | String | Administrator account accessToken |
| expireTime | Long | The expiration time of the administrator account accessToken, in seconds |
Sample output
{
"result":{
"msg":"Successful operation.",
"code":"0",
"data":{
"expireTime":259176,
"accessToken":"At_00006ac6e32d123141238f60147de7ec"
}
},
"id":"98a7a257-c4e4-4db3-a2d3-d97a3836b87c"
}
Error codes
This method may return the codes below. See Return codes and Capability errors for the full catalog.
Gateway and auth (SN / TK / OP)
| Code | Meaning | Next step |
|---|---|---|
SN1001 | Signature error | Check sign per Development specification |
TK1002 | Token invalid or expired | Refresh accessToken |
OP1002 | Missing required parameter | Add required fields |
OP1003 | Invalid parameter | Match this page’s parameter table |
OP1009 | Permission denied | Check token and device bind/share grants |
OP1013 | Total call limit exceeded | Reduce call rate |
OP1014 | Daily per-interface limit exceeded | See Interface call limits |
DV1007 | Device offline | Wait until the device is online |
See Return codes · OP/SN/TK for the full catalog.
