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 Datapoint

Request Method: POST

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

device_id: need to be replaced with device ID

url Parameter

Parameter Name Format Required Description
type string no data format, default to full JSON type (see example)

http body Parameter

Parameter Name Format Required Description
datastreams array-json yes json array of device datastream information, see datastreams description table
datastreams Description Table
Parameter Name Format Required Description
id string yes name of datastream or datastream template
datapoints array-json yes datapoint. can upload multiple datastreams to device cloud at one time. Each datastream can include multiple datapoints. See datapoints description table
datapoints Description Table
Parameter Name Format Required Description
at date no time of uploading datapoint. If null, the device cloud will take the current time. If it exists, its format must be "YYYY-MM-DDThh:mm:ss" (for example: 2015-03-22T22:31:12)
value string/int/json... yes data value

Example of Request Header

POST http://iot.zong.com.pk:8000/devices/2*****30/datapoints HTTP/1.1

Example of Request Parameter

{
    "datastreams": [{
            "id": "temperature",
            "datapoints": [{
                    "at": "2013-04-22T00:35:43",
                    "value": "bacd"
                },
                {
                    "at": "2013-04-22T00:55:43",
                    "value": 84
                }
            ]
        },
        {
            "id": "key",
            "datapoints": [{
                    "at": "2013-04-22T00:35:43",
                    "value": {
                        "x": 123,
                        "y": 123.994
                    }
                },
                {
                    "at": "2013-04-22T00:35:43",
                    "value": 23.001
                }
            ]
        }
    ]
}

Example of Return

{
    "errno": 0,
    "error": "succ"
}

results matching ""

    No results matching ""