Request format: GET
URL: http://api.onenet.hk.chinamobile.com/devices/device_id/datastreams
device_id: to be replaced with device ID
URL request parameter
Name |
Format |
Required or not |
Description |
datastream_ids |
string |
No |
Data stream ID. Multiple IDs are separated by commas. By default, the query is looking for all data streams. |
Name |
Format |
Required or not |
Description |
api- key |
string |
Yes |
masterkey or apikey with the permission for access to the device |
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 |
array- json |
Device-related information returned after interface is successfully called. See the Data Description Table. |
Data Description Table
Name |
Format |
Description |
id |
string |
Data stream ID |
create_time |
string |
Data stream creation time |
update_at |
string |
Upload time of the latest data |
current_value |
string/int/json... |
The latest data point |
Request Example
GET http://api.onenet.hk.chinamobile.com/devices/20474930/datastreams?datastream_ids=aaa,bbb HTTP/1.1
Return Example
{
"errno": 0,
"data": [{
"update_at": "2017-11-20 10:03:10",
"id": "aaa",
"create_time": "2017-11-20 09:59:35",
"current_value": {
"Header": {
"CipherType": 1,
"DevType": 1
},
"Body": 3
}
}, {
"update_at": "2017-12-22 10:30:22",
"id": "bbb",
"create_time": "2017-12-22 10:12:36",
"current_value": 1
}],
"error": "succ"
}