NB-IoT Suite Product Introduction QuickStart User Guide Device Development Guide Application Development Guide Best Practices FAQ Service agreement Update Log

Add new device

Request format:POST

URL: http(s)://api.heclouds.com/devices

I only want to see examples!!!

http body request parameter

NameFormatRequired?Description
titlestringYesDevice name
descstringNoDevice description
tagsarray-stringNoDevice label, string data array
protocolstringYesConnected to the protocol; here it can only be LwM2M.
locationjsonNoDevice location (“latitude”, “longitude”, “height”)
privateboolNoDevice privacy (true, by default)
auth_infojsonYesNBIOT device: {“imei code“: “imsi code“}, imei, imsi rules are specified in the specification.
authstringNoAuth_Code, composed of figures or letters, not exceeding 16 bit
obsvboolNoSubscribing the device resource or not (true, by default) true)
otherjsonNoOther information (JSON format, customizable)
chipintNoCorresponding relation between the test device and the chip type (value selection 1-6); see the specification for details.
pskstringNoPSK for DTLS encryption consists of 8-16 bytes in letters or digits

Return Parameters

NameFormatDescription
errnointCall error code, where 0 means success.
error stringError description, where "succ" means success.
datajsonDevice dependent message returned after the interface is successfully invoked; see Data Description Table
Data Description Table
NameFormatDescription
device_idstringnique ID assigned by the platform
psk stringThe field is returned when NB protocol activates the DTLS encryption function; the field does not exist in other cases.

Description

ClassificationIMEIIMSIchipRemarks
Formal device15digitsNot exceeding 15 digits, not emptyNone The formal device needs no chip value. ch p value
Test device4digitsNot exceeding 15 digits, not emptyValue selection 1-6 The test device needs the chip value.
chip value table
chip value table 1 2 3 4 5 6
Chip name MTK Huawei 120 Huawei 150 Qualcomm Sanechip RDA

Request Example

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

http request parameter example

{
    "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" 
}

Return example

{
    "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.

get-resource-list >

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “