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

Create Device

Request Method: POST

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

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 must be application/json

http body Request Parameter

Parameter Name Format Required Description
title string yes device name
desc string no device description
tags array-string no device tag, string array
protocol string yes access protocol, LWM2M only
location json no device location ("latitude", "precision", "height")
private bool no device privacy (default to true)
auth_info json yes NBIOT device: {"imei code": "imsi code"}, for imei/imsi rules see description
auth string no Auth_Code, consisting of numbers or letters, up to 16 digits
obsv bool no whether to subscribe device resource (default to true)
other json no other information (JSON format, can be customized)
chip int no corresponding relationship between test device and chip type (value range: 1-6), see description for detail

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 unique ID assigned by platform

Description

Type IMEI IMSI chip Note
Normal device 15 digits 15 digits at most, can not be null no for normal device, does not require chip value
Testing device 4 digits 15 digits at most, not null valued 1-6 for testing device, must fill in the chip value
chip Value Correspondence Table
Chip value 1 2 3 4 5 6
Chip Name MTK Huawei 120 Huawei 150 Qualcomm Vimicro RDA

Example of Request

POST http://iot.zong.com.pk:8000/devices HTTP/1.1
api-key: WhI*************v1c=
Content-Type: application/json
Host: iot.zong.com.pk:8000

Example of http Request Parameter

{
    "title": "mydevice",
    "desc": "some description",
    "tags": ["china", "mobile"],
    "protocol": "LWM2M",
    "location": {"lon": 106, "lat": 29, "ele": 370},
    "private": true,
    "auth_info": {"xxxxxxxxxxxx": "xxxxxxxxxxx"},
    "auth":"1233311",
    "obsv": true,
    "other": {"version": "1.0.0", "manu": "china mobile"},
    "chip":1
}

Example of Return

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

results matching ""

    No results matching ""