NB-IoT Suite Product Introduction QuickStart User Guide Device Development Guide Application Development Guide Best Practices FAQ Service agreement Update Log

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 NameFormatRequired?Description
datastream_idstringNoData flow; data flows spaced with comma
startstringNoExtract the starting time at the data point, format: 2015-01-10T08 00 35
endstringNoExtract the end time at the data point, format: 2015-01-10T08 00 35
limitintNoLimit the number of data points returned at most in the request; value selection >0 <= 6000="" <="" td="">
cursorstringNoSpecify the request and continue extracting data from cursor.

Return Parameters

NameFormatDescription
errnointCall error code, where 0 means success.
error stringError description, where "succ" means success.
datajsonDevice dependent message returned after the interface is successfully invoked; see Data Description Table

Data Description Table

NameFormatDescription
cursorstringLocation of the next data point
datastreamsarray-jsonJson array of data stream information of device, see Datastreams Description Table
countintNumber of data flow returned

Datastreams Description Table

NameFormatDescription
idstringData stream name
datapointsarray-jsonjson data array at the data point; see datapoints description list.
statistic jsonjson of the statistical information of data flow; see statistic description list.

Datapoints Description Table

NameFormatDescription
atstringTime
valuestring/arrayData point value
statistic description list
NameFormatDescription
atstringthe time point of an extreme value returned when the extreme value is worked out
valuestringData 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"}

< Query device latest data in batch

real-time command-read device resource >

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “