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

Real-time command-resource subscription

Request format: POST

URL: http(s)://api.heclouds.com/nbiot/observe

I only want to see examples!!!

Url parameter

Parameter NameFormatRequired?Description
imeistringYesIdentity code of nbiot device, required
cancelboolYestrue means cancel the subscription, false means subscription, required
obj_idintYesobject id of nbiot device, equivalent to the data flow id in the platform model, required
obj_inst_idintNoid of a specific instance under the device object, corresponding to a part of key value at the data point in the platform model, optional
res_idintNoResource id of nbiot device, optional
pminintNoThe minimum interval for data upload, 0 by default; in such a case, data will be uploaded if any.
pmaxintNoMaximum time interval for data upload
gtdoubleNoUploaded when the data value is bigger than this value
ltdoubleNoUploaded when the data value is smaller than this value
stdoubleNoWhen the difference between two data values is bigger than or equal to this value
timeoutintNoRequest time-out period, 25 by default (unit: s), value range [ 5,40]

Return Parameters

NameFormatDescription
errnointCall error code, where 0 means success.
error stringError description, where "succ" means success.
Description

1、Return to the meaning corresponding to errno status code; check API status code.

  1. When both pmin and pmax exist, pmax >= pmin and both of them are bigger than 0;

  2. lt\<gt and lt+ 2*st\<gt;

  3. If there is gt, lt, st, res_id is required;

  4. If cancel is non true|false, it will be false by default.

Request Example

POST http://api.heclouds.com/nbiot/observe HTTP/1.1
api-key: WhI*************v1c=  //Must be MasterKey, because it involves personal privacy, use "*******" instead
Content-Type:application/json
Authorization: version=2018-10-31&res=products/23104&et=1554398783&method=sha1&sign=fsBwuj0udOpU3BLoHmpbFwyIo30=

Request parameter example

{
    "imei":xxxx, // The identity code of the nbiot device, consisting of 15 digits;
    "cancel":true|false, //true means unsubscribe, false means subscribe, required
    "obj_id":xxxx, // nbiot 设备的 object id , 对应到平台模型中为数据流 id, 必填
    "obj_inst_id": xxxx, //The object id of the nbiot device, which corresponds to the data stream id in the platform model, is required
    "res_id": 123, // Resource id of the nbiot device, optional
    "pmin":11, //The minimum time interval for uploading data is int type, the default is 0, then upload data when there is data
    "pmax":123,//Maximum time interval for uploading data, int type, optional
    "gt":12, //Upload when the data is greater than this value, double type, optional
    "lt":233, // Upload when the data is less than this value, double type, optional
    "st":12 //Upload when the difference between two data points is greater than or equal to this value, double type, optional
}

Return example

{
    "errno": 0,
    "error": "succ"
} //In the response message, errno represents the error code, and error represents the cause of the error.

< 即时命令-资源发现

即时命令-读设备资源 >

个搜索结果,搜索内容 “

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