Modify Basic Properties

Last Updated on : 2024-09-10 01:49:17

Based on the device ID, modify the basic properties of the specified device. You can modify information such as the device name and icon, as well as latitude and longitude.

API address

POST: /v2.0/cloud/thing/{device_id}/attribute

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringpathtrueThe device ID.

Description of body

Parameter nameTypeINRequiredDescription
typeIntegerbodytrueThe type of the basic properties. Valid values:
  • 1: Modify the device name.
  • 2: Modify the device icon.
  • 3: Modify the latitude and longitude of the device location. The latitude and longitude format is latitude:longitude, separated by a colon. For example, 120.15:30.48.
dataStringbodytrueThe data.

Return parameter

Parameter nameTypeDescription
resultBooleanIndicates whether the operation is successful. Valid values:
  • true: The operation succeeded.
  • false: The operation failed.
successBooleanIndicates whether the API is called successfully. Valid values:
  • true: The API call succeeded.
  • false: The API call failed.
tLongThe timestamp.
tidStringThe link ID.

Request example

POST: /v2.0/cloud/thing/6c19224514c02f7490****/attribute
{
  "type": 1,
  "data": "Main Bedroom Light"
}

Return example

{
    "tid": "b8a2b49abbbc11eda71e169efc83a172",
    "result": true,
    "t": 1678065474602,
    "success": true
}

Error code

For more information, see error code.

Limits on API Request Frequency

For more information, see Limits on API Request Frequency.