Batch Inquire Device Latest Data
Request Method: GET
URL: http://api.heclouds.com/devices/datapoints
Parameter Name |
Format |
Required |
Description |
api-key |
string |
yes |
must be masterkey or apikey with access authority of the device |
url Parameter
Parameter Name |
Format |
Required |
Description |
devIds |
string |
yes |
device ids, separated by commas, upper limites 500 devices |
Return Parameter
Parameter Name |
Format |
Description |
errno |
int |
code for call error , 0 indicates call is successful |
error |
string |
error description, "succ" indicates call is successful |
data |
json |
device data related information returned after successful interface call, see data description table |
data Description Table
Parameter Name |
Format |
Description |
devices |
array-json |
json array of device latest data, see devices description table |
devices Description Table
Parameter Name |
Format |
Description |
id |
string |
device id |
title |
string |
device name |
datastreams |
array-json |
json array of the latest data of datastream, see datastreams description table |
datastreams Description Table
Parameter Name |
Format |
Description |
id |
string |
datastream name |
at |
string |
time |
value |
string |
latest data value |
Example of Request
GET http://api.heclouds.com/devices/datapoints?devIds=12323,12324 HTTP/1.1
api-key: WhI*************v1c=
Content-Type: application/json
Host: api.heclouds.com
Example of Return
{
"errno": 0,
"data": {
"devices":[
{
"id":12323,
"title":"daf",
"datastreams":[
{
"id":"temperature",
"at":"2017-02-12 10:22:22",
"value":"12"
},
...
]
},
{
"id":12324,
"title":"daf",
"datastreams":[
{
"id":"temperature",
"at":"2017-02-12 10:22:22",
"value":"15"
},
...
]
},
...
]
},
"error": "succ"
}