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

real-time command-write device resource

Request format: POST

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

I only want to see examples!!!

Url parameter

Parameter NameFormatRequired?Description
imeistringnbiot device identity code
obj_idintObject id of device, equivalent to the data flow id in the platform model, required
obj_inst_idintid of a specific instance under nbiot device object, corresponding to a part of key value at the data point in the platform model, required
modeintwrite mode; it can only be 1 or 2.
timeoutintRequest time-out period, 25 by default (unit: s), value range [ 5,40]

Http request parameter

Parameter NameFormatRequired?Description
dataarray-jsonyesjson data array of write device resource, size restricted to be 2k; see data request parameter description list.
Data Description Table
Parameter NameFormatRequired?Description
res_idintyesResource id of specified write operation
typeintnoSupport 1 and 2 at present. 1 means the resource type is Opaque; in such a case, val field is the hexadecimal character string corresponding to the binary system. 2 means the resource type is Time; in such a case, val field is the time stamp (expressed in seconds, value); If it’s left blank, it means the resource type is the basic data type.
valobjectyesDecide val data type according to the specified resource type; it can be boolean, string, long, double.

Return Parameters

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

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

1.mode value selection:

(1) represents replace, meaning to replace the specified instance or resource value;

(2) Represents partial update, meaning only updating the given resource or resource instance value.

  1. HTTP content must exist.

  2. Type field optional; at present, it supports 1 and 2. 1 means the resource type is Opaque; in such a case, val field is the hexadecimal character string corresponding to the binary system. 2 means the resource type is Time; in such a case, val field is the time stamp (expressed in seconds, value);)

Request Example

POST http://api.heclouds.com/nbiot 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

Non-opaque type:
{
    "data":[
        {
            "res_id":12,
            "val":121
        }
    ]
} //The HTTP content part must exist.

opaque type:
{
    "data":[
        {
            "res_id":12,
            "type":1,
            "val":121
        }
    ]
} //The HTTP content part must exist.

Return Example

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

< real-command-read device resource

real-command command release >

个搜索结果,搜索内容 “

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