Add a Device
Add a device to Milesight Development Platform and associate it with the current Application.
Request URL
POST {base_url}/device/openapi/v1/devices
Request Parameters
Parameter | Required | Type | Description |
---|---|---|---|
Authorization | Yes | String | The valid access token for making API calls. The format should be Bearer {access_token}. |
Parameter | Required | Type | Description |
---|---|---|---|
snDevEUI | Yes | String | The SN (serial number) or EUI (Extended Unique Identifier) of the device. |
name | Yes | String | Specify a name to help you identify this device. |
description | No | String | Enter the device description. |
autoProvision | No | Boolean | Whether to enable Auto Provision for this device, which will
automatically apply pre-configured settings from a Profile template
to this device after addition. Valid value:
|
config | No | JSON |
The config template for Auto Provision, which is presented in JSON format.
|
project | No | String | Specify a tag to help you identify and categorize devices. |
tag | No | Array<String> | Specify tags to help you identify and categorize devices. One device supports to add 20 tags at most. |
Response Parameters
Parameter | Type | Description |
---|---|---|
data | Object<Device_Info> | Information of the added device. |
status | String | The result of the API request.
|
requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
- Device_Info
-
Parameter Type Description sn String The SN (Serial Number) of this device. deviceId Long The unique ID of this device on Milesight Development Platform. Note: It is recommended to save this deviceID for future use, as it is required for managing or configuring the device through the API.devEUI String Note: Depending on the product model, this parameter may NOT be returned.The EUI (Extended Unique Identifier) of this device.imei String Note: Depending on the product model, this parameter may NOT be returned.The IMEI (International Mobile Equipment Identity) of this device.
Examples
- Request example
- Add VS121-P to Milesight Development Platform and associate with this Application.
- Response example
-
HTTP/1.1 200 OK { "data": { "sn": "66003649xxxx", "deviceId": "1737007595605147649" }, "status": "Success", "requestId": "22bd34b548bca2981b4bb5f222523caf" }