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

# Add Datastream Request Method: POST

URL: http://iot.zong.com.pk:8000/devices/device_id/datastreams

device_id: need to be replaced with device ID

http body Parameter

Parameter Name Format Required Description
id string yes datastream ID, ie datastream name
tags array-string no datastream tags, can be one or more
unit string no data unit
unit_symbol string no data unit symbol
cmd string no command sent periodically, hexadecimal byte string
example: 010300000002c40b
interval int no Sampling cycle
formula string no calculation formula of register
example: (A0 + A1) indicates to add together value of register 0 and value of register 1

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 device related information returned after successful interface call, see data description table
data Description Table
Parameter Name Format Description
ds_uuid string unique ID of datastream inside platform

Example of Request Header

POST http://iot.zong.com.pk:8000/devices/20474930/datastreams HTTP/1.1

Example of Request Parameter

{
    "id": "speed",
    "cmd": "010300000002c40b",
    "interval": 10
}

Example of Return

{
    "errno":0,
    "data": {
        "ds_uuid":"856f8622-64e7-5549-8e55-44931f07db6e"
    },
    "error":"succ"
}

results matching ""

    No results matching ""