Check data point
Request format: GET
URL: http(s)://api.heclouds.com/devices/{device_id}/datapoints
Note: device_id needs to be replaced by device ID.
I only want to see examples!!!
Url parameter
Parameter Name | Format | Required? | Description |
datastream_id | string | No | Data flow; data flows spaced with comma |
start | string | No | Extract the starting time at the data point, format: 2015-01-10T08 00 35 |
end | string | No | Extract the end time at the data point, format: 2015-01-10T08 00 35 |
limit | int | No | Limit the number of data points returned at most in the request; value selection >0 <= 6000="" <="" td="">=> |
cursor | string | No | Specify the request and continue extracting data from cursor. |
Return Parameters
Name | Format | Description |
errno | int | Call error code, where 0 means success. |
error | string | Error description, where "succ" means success. |
data | json | Device dependent message returned after the interface is successfully invoked; see Data Description Table |
Data Description Table
Name | Format | Description |
cursor | string | Location of the next data point |
datastreams | array-json | Json array of data stream information of device, see Datastreams Description Table |
count | int | Number of data flow returned |
Datastreams Description Table
Name | Format | Description |
id | string | Data stream name |
datapoints | array-json | json data array at the data point; see datapoints description list. |
statistic | json | json of the statistical information of data flow; see statistic description list. |
Datapoints Description Table
Name | Format | Description |
at | string | Time |
value | string/array | Data point value |
statistic description list
Name | Format | Description |
at | string | the time point of an extreme value returned when the extreme value is worked out |
value | string | Data point value |
Description
1.carrying no parameters, direct call; return the latest data of all data flows of the device. If the device has three data flows, return the last data in each data flow of the three.
2.Carrying no data flow id parameter; when carrying limit parameter, at most limit data of each data flow of the device will be returned. Wherein, datastreamid equals to objid_obj_inst_id res d, if obj d 3200, obj_inst d 0, res d 5501, then datastream d is 3200_0_5501.
3.To check the data of a certain data flow in a certain time range, add start and end parameters. Note that if start parameter exists and end parameter does not exist, it means all data following start will be taken; if start does not exist, and end exists, the device cloud will neglect end parameter. The maximum time interval between start and end is 1 year; after one year, it will be neglected.
4.If start parameter is specified, there may be many data points returned; in such a case, at most 100 data points will be returned by default. limit parameter can be used; set the number of data points returned, at most 6000 data points. When the actual number of data points is more than the limit number, there will be a cursor field in the json string returned; the cursor field can be carried in the command line of the next request, showing it will continue traversing the data flow. The cursor field marks the location of the next data point after the last data point is taken out.
Request Example
GET http://api.heclouds.com/devices/564280/datapoints? datastream_id=3200_0_5501&start=2015-11-30T17:12:33&end=2015-12-01T17:22:33&limit=5&cursor=25971_564280_1448961024981 HTTP/1.1
api-key: WhI*************v1c=
Return example
{
"errno":0,
"data":{
"cursor":"25971_564280_1448961152173",
"count":5,
"datastreams":[
{
"datapoints":[
{
"at":"2015-12-01 17:10:24.981",
"value":"35"
},
{
"at":"2015-12-01 17:10:53.406",
"value":"38"
},
...
],
"id":"3200_0_5501"
},
...
]
},
"error":"succ"}