OneNET IoT Platform Platform Introduction Introduction Manual Guidline for Device Development Guideline for Application Development
API
API Usage API List SDK MQTT LwM2M EDP Modbus TCP
HTTP Push

Cache Command - Write Device Resource / Write

Request Method: POST

URL: http://iot.zong.com.pk:8000/nbiot/offline

http Header

Parameter Name Format Required Description
api-key string yes must be masterkey or apikey with access authority of the device
Content-Type string yes application/json

url Parameter

Parameter Name Format Required Description
imei string yes identity code of nbiot device
obj_id int yes object id of nbiot device, corresponding to datastream id of the platform model
obj_inst_id int yes a specific instance id under device object, corresponding to part of datapoint key value in the platform model
mode int yes write-mode, can be 1 or 2 only
valid_time string no timestamp for command to take effect, optional (default to current time of OneNET when not filled in)
expired_time string yes timestamp for command to expire, which must be greater than valid_time
retry int no [0 10], indicates number of failed retries (waiting for next device update or online), default to 3
trigger_msg int no upstream message type triggered by the command, the value to be filled in must be between [1, 7]

http Request Parameter

Parameter Name Format Required Description
data array-json yes write json array of device resource, see data request parameter description table
data Request Parameter Description Table
Parameter Name Format Required Description
res_id int yes resource id of nbiot device
type int no currently only support 1, here data is a hexadecimal string
val object yes value, which can be boolean, string, long, double

Return Parameter

Parameter Name Format Description
errno int code for call error , 0 indicates call is successful
error string error description, "succ" indicates call is successful
data json Related information returned after successful interface call, see data description table
Data Description Table
Parameter Name Format Description
uuid string offline command uuid
Description
trigger_msg trigger type:
1. REGISTER
2. UPDATE
3. REGISTER | UPDATE COMBINATION
4. NOTIFY
5. REGUSTER | NOTIFY COMBINATION
6. UPDATE | NOTIFY COMBINATION
7. NOTIFY | UPDATE | REGISTE COMBINATION

Example of Request

POST http://iot.zong.com.pk:8000/nbiot/execute/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=
Content-Type: application/json
Host: iot.zong.com.pk:8000

Example of Request Parameter

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

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

Example of Return

{
    "errno": 0,
    "data": {
        "uuid":"42742677-adc3-54ca-83a1-5aaaf71482f8"
    },
    "error": "succ"
}

results matching ""

    No results matching ""