Update a Device Information

Update the device's name, description and tag.

Request URL

PUT {base_url}/device/openapi/v1.0/devices

Request parameters

Table 1. Header Parameters
Parameter Required Type Description
Authorization Yes String The valid access token for making API calls.

The format should be Bearer {access_token}.

Table 2. Body parameters
Parameter Required Type Description
deviceId Yes Integer The unique ID of this device, which is returned when you add the device.
Note: If you did NOT save the deviceID, you can query the device's ID using Search Specific Devices.
name Yes String Update the device name.
description No String Update the device description.
project No String Update the device's tag.

Response parameters

Parameter Type Description
data Object<Device_Info> Information of the updated device.
status String The result of the API request.
  • Success
  • Failed
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 Integer 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
Update the name and tag of the device with the ID "1742010610312101890".
PUT /device/openapi/v1.0/devices HTTP/1.1
Host: milesight.demo.com
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InllYXN0b25lLWRlZmF1bHQta2V5LWlkIn0.eyJncmFudF90eXBlIjoiY2xpZW50X2NyZWRlbnRpYWxzIiwic2NvcGUiOlsib3BlbmFwaSJdLCJjbGllbnRfZXh0Ijp7ImFwcF9pZCI6IjE3MzY5NTQ4MDE3MTMzMjgxMzAifSwiZXhwIjoxNzAzMjEzMDk4LCJhdXRob3JpdGllcyI6WyJST0xFX0NMSUVOVCJdLCJqdGkiOiJiYjJjN2U4Yy03NGQwLTQ4NjEtODE3MS1iYTc0NWRlMGY0NmQiLCJjbGllbnRfaWQiOiI4OTNkNzdjNy1mMGNiLTRmMzQtOWNhMS03YzJhNGNmMTEzNDgiLCJ0cyI6MTcwMzIwOTQ5ODMzNH0
Content-Type: application/json
User-Agent: OpenAPI

{
    "deviceId": "1742010610312101890",
    "name": "Comfort Sensor Room-3D",
    "project": "Workplace"
}
Response example
HTTP/1.1 200 OK
{
    "data": {
        "sn": "6785C38073640023",
        "deviceId": "1742010610312101890",
    },
    "status": "Success",
    "requestId": "f3f81c188c03c4b098a83503109802d2"
}