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

cache command-write device resource/ Write

Request format: POST

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

I only want to see examples!!!

Url parameter

Parameter NameFormatRequired?Description
imeistringYes Identity code of nbiot device, required
obj_idintYesObject id of device, equivalent to the data flow id in the platform model, required
obj_inst_idintYesnbiotid of a specific instance under nbiot device object, id of instance, corresponding to a part of key value at the data point in the platform model, required
modeintYeswrite mode; it can only be 1 or 2.
valid_timestringNoCommand effective time, optional (When it’s left blank, it’s the current time of OneNET by default); when it’s filled in, it shall be bigger than the current time of OneNET server.
expired_timestringYesCommand expiration time stamp, required, bigger than val
retryintNoBetween [0-10]; times of retry after failure (waiting for the device update or online next time), optional (when left blank, 3 by default); when it’s filled in, it shall be between [0, 10].
timeoutintNoNoExpiration time; when it’s filled in, it shall be between [5, 40]s; when left blank, it’s 25s by default.
trigger_msgintNoCommand trigger uplink message type; when it’s filled in, it shall be between [1, 7]; when left blank, it’s 7 by default.

http request parameter

Parameter NameFormatRequired?Description
dataarray-jsonjson data array of write device resource, size restricted to be 2k; see data request parameter description list.

data request parameter description list

Parameter NameFormatRequired?Description
res_idintYesResource id of nbiot device
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.
valobjectYesValue, can be boolean, string, long, double

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
uuidstring Cache command uuid
Description

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

trigger_msg Trigger type:
1. REGISTER   
2. UPDATE   
3. REGISTER | UPDATE combination  
4. NOTIFY
5. REGISTER | NOTIFY combination
6. UPDATE | NOTIFY combination
7. NOTIFY | UPDATE | REGISTER combination

请求示例

POST http://api.heclouds.com/nbiot/offline?imei=86582003***&valid_time=2016-08-05T08:00:00&expired_time=2016-08-06T08:00:00&obj_id=1212&obj_inst_id=1212&mode=1 HTTP/1.1
api-key: WhI*************v1c=  //Must be MasterKey, because it involves personal privacy, use "*******" instead
Content-Type: application/json

Example of request parameter

Non-opaque type:
{
    "data":[
        {
            "res_id":12,
            "val":121
        }
    ]
}

opaque type:
{
    "data":[
        {
            "res_id":12,
            "type":1,
            "val":"121A"
        }
    ]
}

Return example

{
    "errno": 0,
    "error":"succ",
    "data":
        {
         "uuid":"42742677-adc3-54ca-83a1-5aaaf71482f8"//Cache command uuid
        }
} //In the response message, errno represents the error code, and error represents the cause of the error.

< cache-read-dev-res

cache-comm-issue>

个搜索结果,搜索内容 “

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