Query device history command
Request format: GET
URL: http://api.onenet.hk.chinamobile.com/cmds/history/device_id
device_id: to be replaced with device ID
URL Parameters
Name |
Format |
Required or not |
Description |
start |
date |
Yes |
Start time of query. Format example: 2015-01- 10T08:00:35. |
end |
date |
No |
End time of query. Format example: 2015-01- 10T08:00:35. |
page |
int |
No |
Specify the page number. |
per_page |
int |
No |
Specify the number of output devices per page, 30 by default, max. 100 |
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 |
page |
int |
Current page number |
per_page |
int |
Total number per page currently |
total_count |
int |
Total |
items |
array- json |
For device history commands, see the description table of items. |
Description table of items
Name |
Format |
Description |
cmd_uuid |
string |
Command ID |
device_id |
string |
Device ID |
expire_time |
date |
Expiration time |
status |
int |
Command status |
send_time |
date |
Sending time |
confirm_time |
date |
Response time |
confirm_body |
string |
Response content, hexadecimal characters |
body |
string |
Request content, hexadecimal characters |
Request Example
GET http://api.onenet.hk.chinamobile.com/cmds/history/3****78?start=2015-01-10T08:00:35 HTTP/1.1
Return example
{
"errno": 0,
"error": "succ",
"data": {
"page": 1,
"per_page": 10,
"total_count": 100,
"items": [{
"cmd_uuid": "2302-312-21dgaapbafddfs",
"device_id": 223422,
"expire_time": "2016-07-05 00:00:00",
"send_time": "2016-07-05 00:00:00",
"confirm_time": "2016-07-05 00:00:00",
"confirm_body": "2463726571007b202274797022",
"body": " 2463726571007b202274797022"
},{
"cmd_uuid": "rezcgt2-se12-F2323Wdadfadfs",
"device_id": 223422,
"expire_time": "2016-07-05 01:01:01",
"send_time": "2016-07-05 03:01:02",
"confirm_time": "2016-07-05 02:02:02",
"confirm_body": "2463726571007b202274797022",
"body": " 2463726571007b202274797022"
},{...}
]
}
}