Register Device
Request format: POST
URL: http://api.onenet.hk.chinamobile.com/register_de
URL Parameters
Name |
Format |
Required or not |
Description |
register_code |
string |
Yes |
Registration code, unique under the product |
http bdoy parameters
Name |
Format |
Required or not |
Description |
sn |
string |
Choose it or mac |
User-defined product serial number (maximum length: 512) |
mac |
string |
Choose it or sn |
User-defined mac address (maximum length: 32) |
title |
string |
No |
Device name (maximum length: 32). If it is null, the platform will assign the device name “auto_register” by default. |
Return Parameters
Name |
Format |
Description |
errno |
int |
Call error code, where 0 means success. |
error |
string |
Error description. “succ” means the call is successful. |
data |
json |
Device-related information returned after interface is successfully called. See the Data Description Table. |
Data Description Table
Name |
Format |
Description |
device_id |
string |
Device ID |
key |
string |
apikey for device access permission only |
Example of request body
{
"sn": "1o8oy2oionadf",
"title": "test_device"
}
Return Example
{
"errno": 0,
"data": {
"device_id": "35270468",
"key": "=BH7aIa62iJH73t4ZwIory3ne=8="
},
"error": "succ"
}