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 MQ
Other Service Common Question

Instant Command - Read Device Resources

Request Method: GET

URL: http://api.heclouds.com/nbiot

http Header

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

url Parameter

Parameter Name Format Required Description
imei string yes identity code of nbiot device
obj_id int yes object id of device, determined according to sdk of terminal device
obj_inst_id int no a specific instance id under nbiot device object, determined according to sdk of terminal device
res_id int no resource id of nbiot device , determined according to terminal device sdk
timeout int no time for request timeout, default to 25 (unit: second), range of values [5, 40]

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 array-json device resource related information returned after successful interface call, see data description table
data Description Table
Parameter Name Format Description
obj_inst_id int object instance id
res array-json res list
res Description Table
Parameter Name Format Description
res_id int resource id
val object read the value of the resource, which can be bool, string, long, double, etc.
Description

For the meaning of returned errno status code, can [Dowenload for view] in the OneNET Documentation Center -> Device Development Guide -> Protocol Document -> “Description of Returned Status Code of Northbound api in NB Protocol” in LWM2M (/book/device-develop/multpro /sdk-doc-tool/doc.md)

When obj_instance_id does not exist, resource_id must not exist.

Example of Request

GET http://api.heclouds.com/devices/nbiot HTTP/1.1
api-key: WhI*************v1c=
Host: api.heclouds.com

Example of Return

{
    "errno": 0,
    "data": [
        {
            "obj_inst_id": 123,
            "res":[
                {
                    "res_id": 1234,
                     "val": 12
                }
            ]    
        }
    ],
    "error": "succ"
}

results matching ""

    No results matching ""