Sets tags for a specified device.
DISCLAIMER
Please note that all content presented on this page is provided by Tuya (HK) Limited. Alibaba Cloud makes no representations and warranties, explicit or implied, as to the authenticity or accuracy of any such content, nor makes any guarantee to the condition, quality, durability, performance, reliability, merchantability or fitness for a particular purpose, or non-infringement of any products and/or services made available by Tuya (HK) Limited.
Sets tags for a specified device.
Instructions for use
●A single device supports up to 100 tags. ●You can modify or add up to 100 tags at a time.
Request Parameters
|
Name |
Type |
Required |
Sample Values |
Description |
|
Action |
String |
Yes |
SaveDeviceProp |
System-defined parameter. Value: SaveDeviceProp. |
|
Props |
String |
Yes |
{"color":"red"} |
The device tags to set. Multiple tags are supported. Device tags are in JSON format. Each tag uses the following structure: Key:Value . Key is the tag name, and Value is the corresponding tag value. Separate multiple tags with commas, for example, Props={"color":"red","shape":"round"} . |
|
ProductKey |
String |
No |
A1BwAGV * * * * |
The ProductKey of the product to which the device belongs. |
|
DeviceName |
String |
No |
Light |
The device name. |
|
IoTID |
String |
No |
**** 00100 |
The device ID issued by the IoT platform. This is the unique identifier of the device. |
Note: In addition to the request parameters described in this topic, you must also pass in common request parameters when calling the API. For more information, see Common parameters.
Return data
|
Name |
Type |
Sample Values |
Description |
|
Code |
String |
Iot.system.SystemException |
The error code returned if the call fails. For more information, see Error codes. |
|
ErrorMessage |
String |
System Exception |
The error message returned if the call fails. |
|
Request ID |
String |
E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565 |
The unique request ID. |
|
Success |
Boolean |
True |
Indicates whether the call succeeded. ●True : The call succeeded. ●False : The call failed. |
Example
Sample request
curl 'https://si-d6e8d812acb848958054.tuyacloud.com:8686/?Action=SaveDeviceProp&SignatureNonce=54dbd8cf9ffa4e448b87f9283499f290&AccessKeyId=xMr9wgwXQLhv5AUa65o03mcD&SignatureMethod=HMAC-SHA1&Props=%7B%22color%22%3A%22red%22%7D&Timestamp=2024-11-19T08%3A42%3A04Z&ProductKey=k1ymv1DuLfE&DeviceName=myTestDevice&Signature=8Z9ZAjG4BUAq987AilVJRVnWVh0%3D'
Sample response
{
"RequestId":"57b144cf-09fc-4916-a272-a62902d5b207",
"Success": true
}