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 Device

Request Method: POST

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

http body Parameter

Parameter Name Format Required Description
title string yes device name
desc string no device description
tags array-string no device tags, can be one or more, see example
location json no device location coordinate information, expressed in latitude and longitude key-value pairs: {"lon":xx,"lat":xx}
private bool no device privacy, determine the visibility of device information in share links from application editor , and default to true
auth_info string no authentication information, recommend to carry, and set it as product serial number of device
other json no other custom information of device, expressed in key-value pair format, see example

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
device_id string device ID

Example of Request body

{
    "title": "test_device",
    "desc": "test_desc",
    "tags": ["china", "mobile"],
    "location": {
        "lon": 109,
        "lat": 23.54
    },
    "auth_info": "tes01235n82105",
    "other": {
        "version": "1.0.0",
        "manufacturer": "china mobile"
    }
}

Example of Return

{
    "errno": 0,
    "data": {
        "device_id": "35270468"
    },
    "error": "succ"
}

results matching ""

    No results matching ""