Request conventions
Request conventions
Values below are copied from Development specification. This page does not add headers or methods that page does not state.
DataCenter host
Imou Cloud OpenPlatform provides access domain names in multiple regions. Select the host for the data center of the developer account. See the id in Control Board - Basic Information - My Information.
Method pages use:
https://openapi-[DataCenter].easy4ip.com/openapi/{method}
v2 capability methods use /openapi/v2/{methodName}. See Capability usage.
POST body
The open platform HTTP request format convention is as follows:
| Field | Type | Description |
|---|---|---|
| system.ver | String | Protocol version information, currently 1.0 |
| system.sign | String | Signature value, used by the platform for signature verification. The calculation steps are on Signature |
| system.appId | String | appId, obtained from Control Board - My App - App Information |
| system.time | Long | The time stamp of the client that initiated the interface call (UTC timestamp, in seconds), the time is synchronized with the easy4ip open platform (the difference between the two cannot be 5 minutes) |
| system.nonce | String | Random number (32 bits). The nonce cannot be repeated within 5 minutes, otherwise SN1005 error code will be returned. |
| params | Map | The parameter set used by the HTTP interface method, the value is the assembled Map object |
| id | String | Request a unique identification ID, and pass in a unique non-empty string each time the request is called |
Take the accessToken interface for obtaining the administrator account as an example:
{
"system": {
"ver": "1.0",
"appId": "lcdxxxxxxxxx",
"sign": "xjhCQBoJ9hRDsCjyDcHjtDNzRZ3ZJezcawsfWeiaoxU=",
"time": 1706511734,
"nonce": "f5a1ae2d-c09c-4d39-a744-83a5c2c653c2"
},
"id": "98a7a257-c4e4-4db3-a2d3-d97a3836b87c",
"params": {}
}
Do not copy sign from the sample. Compute it per request.
This book does not document extra mandatory HTTP headers beyond the JSON body on that specification page.
Response body
| Field | Type | Description |
|---|---|---|
| result.code | String | Request return code, see Return codes |
| result.msg | String | Request return code description string |
| result.data | Map | The specific content information returned by the request interface |
| id | String | The id passed in by the developer when requesting the interface |
{
"result":{
"msg":"The operation was successful.",
"code":"0",
"data":{
"expireTime":259176,
"accessToken":"At_00006ac6e32d123141238f60147de7ec"
}
},
"id":"98a7a257-c4e4-4db3-a2d3-d97a3836b87c"
}
Success is result.code "0".
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.
Sub-accounts (SUB)
| Code | Meaning | Next step |
|---|---|---|
SUB1001–SUB1002 | Sub-account lacks API permission | Update policy via addPolicy |
SUB1005 | Sub-account token expired | Refresh subAccountToken |
SUB1006 | No device grant for sub-account | Check Resource and device serial |
SUB1008 | Sub-account not bound to app | Create and bind the sub-account first |
See Return codes · SUB.
Device access and channels (DV10xx)
| Code | Meaning | Next step |
|---|---|---|
DV1007 | Device offline or timeout | Wait for the device to come online |
DV1009 | Device busy | Retry later |
DV1012 | Insufficient share/grant permission | Check sub-account Permission / Resource |
DV1019 | Capability not supported | Confirm model and capability list |
DV1020 | Channel offline | Check channel status |
DV1026 | Function not supported | Use another API or upgrade firmware |
DV1028 | Not bound or channel missing | Verify deviceId / channelId |
See Return codes · DV.
