Request format: POST
URL: http(s)://api.heclouds.com/nbiot/observe
I only want to see examples!!!
Parameter Name | Format | Required? | Description |
---|---|---|---|
imei | string | Yes | Identity code of nbiot device, required |
cancel | bool | Yes | true means cancel the subscription, false means subscription, required |
obj_id | int | Yes | object id of nbiot device, equivalent to the data flow id in the platform model, required |
obj_inst_id | int | No | id 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_id | int | No | Resource id of nbiot device, optional |
pmin | int | No | The minimum interval for data upload, 0 by default; in such a case, data will be uploaded if any. |
pmax | int | No | Maximum time interval for data upload |
gt | double | No | Uploaded when the data value is bigger than this value |
lt | double | No | Uploaded when the data value is smaller than this value |
st | double | No | When the difference between two data values is bigger than or equal to this value |
timeout | int | No | Request time-out period, 25 by default (unit: s), value range [ 5,40] |
Name | Format | Description |
---|---|---|
errno | int | Call error code, where 0 means success. |
error | string | Error description, where "succ" means success. |
1、Return to the meaning corresponding to errno status code; check API status code.。
When both pmin and pmax exist, pmax >= pmin and both of them are bigger than 0;
lt\<gt and lt+ 2*st\<gt;
If there is gt, lt, st, res_id is required;
If cancel is non true|false, it will be false by default.
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=
{
"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
}
{
"errno": 0,
"error": "succ"
} //In the response message, errno represents the error code, and error represents the cause of the error.