Send command
Request format: POST
URL:http://api.onenet.hk.chinamobile.com/cmds
URL Parameters
Name |
Format |
Required or not |
Description |
device_id |
string |
Yes |
ID of the device receiving the data |
http request content
Name |
Format |
Required or not |
Description |
cmd |
string |
Yes |
The format should be hexadecimal data in a string form. See the example. |
http request return parameters
Name |
Format |
Description |
errno |
int |
Call error code, where 0 means success. |
error |
string |
Error description. “succ” means the call is successful. |
data |
json |
Device-related information returned after interface is successfully called. See the Data Description Table. |
Data Description Table
Name |
Format |
Description |
cmd_uuid |
string |
Command id, unique within the platform |
POST http://api.onenet.hk.chinamobile.com/cmds?device_id=8029377 HTTP/1.1
Example of request parameter
{
"cmd":"07030001000295AD"
}
Return example 1: Successfully create a command.
{
"errno": 0,
"error": "succ",
"data": {
"cmd_uuid": "81572aae-fc34-5deb-8f06-ab45d73cb12b"
}
}
Return example 2: The device is offline.
{
"errno": 10,
"error": "device not online: 8029377"
}