Request format:POST
URL: http(s)://api.heclouds.com/devices
I only want to see examples!!!
Name | Format | Required? | Description |
---|---|---|---|
title | string | Yes | Device name |
desc | string | No | Device description |
tags | array-string | No | Device label, string data array |
protocol | string | Yes | Connected to the protocol; here it can only be LwM2M. |
location | json | No | Device location (“latitude”, “longitude”, “height”) |
private | bool | No | Device privacy (true, by default) |
auth_info | json | Yes | NBIOT device: {“imei code“: “imsi code“}, imei, imsi rules are specified in the specification. |
auth | string | No | Auth_Code, composed of figures or letters, not exceeding 16 bit |
obsv | bool | No | Subscribing the device resource or not (true, by default) true) |
other | json | No | Other information (JSON format, customizable) |
chip | int | No | Corresponding relation between the test device and the chip type (value selection 1-6); see the specification for details. |
psk | string | No | PSK for DTLS encryption consists of 8-16 bytes in letters or digits |
Name | Format | Description |
---|---|---|
errno | int | Call error code, where 0 means success. |
error | string | Error description, where "succ" means success. |
data | json | Device dependent message returned after the interface is successfully invoked; see Data Description Table |
Name | Format | Description |
---|---|---|
device_id | string | nique ID assigned by the platform |
psk | string | The field is returned when NB protocol activates the DTLS encryption function; the field does not exist in other cases. |
Classification | IMEI | IMSI | chip | Remarks |
---|---|---|---|---|
Formal device | 15digits | Not exceeding 15 digits, not empty | None | The formal device needs no chip value. ch p value |
Test device | 4digits | Not exceeding 15 digits, not empty | Value selection 1-6 | The test device needs the chip value. |
chip value table | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
Chip name | MTK | Huawei 120 | Huawei 150 | Qualcomm | Sanechip | RDA |
POST http://api.heclouds.com/devices HTTP/1.1
api-key: WhI*************v1c= //Must be MasterKey, because it involves personal privacy, use "*******" instead
Content-Type: application/json
{
"title": "mydevice", // device name
"desc": "some description", //device description(Optional)
"tags": ["china", "mobile"], // Device label (optional, can be one or more)
"protocol": "LwM2M", //Access protocol
"location": {"lon": 106, "lat": 29, "ele": 370}, //Device location {"atitude", "longitude", "height"}(Optional)
"private": true, //Device privacy (optional, default is true)
"auth_info": {"xxxxxxxxxxxx": "xxxxxxxxxxx"}, //NBIOT device: {"imei": "imsi"}, imei (must be 15 digits) and imsi (no more than 15 digits) are composed of numbers, and the first digit cannot be 0
"auth":"1233311",
"obsv": true, //Whether to subscribe to device resources, the default is true
"other": {"version": "1.0.0", "manu": "china mobile"}, //Other information (optional, JSON format, customizable)
"chip":1, //Refer to the chip value correspondence table
"psk":"dafdfdsafd"
}
{
"errno": 0, //No error
"data": {
"device_id": "23444", //The platform assigns a unique ID
"psk":"23ddafd3444"
},
"error": "succ"
}
⋙⋙⋙⋙⋙
Description:
(1) In the response message, errno represents the error code, error representst the error reason; if creation of the device fails, there will be no device_id field;
(2) Both imei (15 digits) and imsi (not exceeding 15 digits, not blank) in auth_info of NB Coapidevice are composed of digits.