Update Device Information

Last Updated on : 2023-06-20 12:39:05

Update the device information based on the device ID.

API address

PUT: /v1.0/iot-03/3rdcloud/devices/{device_id}

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe ID of the specified Tuya-enabled device.

Description of body

Parameter nameTypeINRequiredDescription
device_nameStringbodyfalseThe name of the specified device, with no more than 50 characters.
optionsObjectbodyfalseThe extension information about the specified device. Valid values:
  • installLocation: the installation location.
  • outProjectId: the project ID of the device in the partner cloud.
  • mac: the MAC address.
  • extendData: in JSON format, such as: {"roomNo":"16"}, where roomNo is the hotel room number.

Return parameter

Parameter nameTypeDescription
resultBooleanThe response result.
codeStringThe response code. It is empty when the request succeeded.
msgStringThe message that is returned if the request fails. It is empty if the request is successful.
successBooleanIndicates whether the request is successful. Valid values:
  • true: success.
  • false: failure.
tLongThe 13-digit timestamp of a response.

Request example

PUT: /v1.0/iot-03/3rdcloud/devices/6cf4171005d11e2ca7****
{
  "device_name": "Test Device",
  "options": {
    "mac": "48ea63fd****",
    "installLocation": "****Jiangdun Road, Xihu District, Hangzhou City",
  }
}

Return example

{
    "result": true,
    "t": 1650004025390,
    "success": true
}

Error code

For more information, see error code.