Call this operation to create, update, or delete tags of a group.

Limits

You can create up to 100 tags for a group.

Request parameters

Parameter Type Required Description
Action String Yes The action that you want to perform. Set the value to SetDeviceGroupTags.
GroupId String Yes The unique identifier of a group.
TagString String Yes Data of tags in JSON format. TagString consists of tag keys and tag values. Separate tags with commas, for example, TagString="[{"tagKey":"hh","tagValue":"rr"}]". See the following table TagString.

If you want to update a tag, enter the target tag key and specify a new tag value. The new tag value will overwrite the previous tag value.

If you want to delete a tag, do not enter the target tag key or tag value in the request.

Common request parameters - Yes See Common parameters.
Table 1. TagString
Parameter Type Required Description
tagKey String Yes The key of the tag. It can contain English letters, numbers, and dots (.) and be 2-30 characters in length.
tagValue String Yes The value of the tag. It can contain Chinese characters, English letters, numbers, underscores (_), and hyphens (-), and cannot exceed 128 characters. A Chinese character is counted as 2 characters.

Response parameters

Parameter Type Description
RequestId String The globally unique ID generated by Alibaba Cloud for the request.
Success Boolean Indicates whether the call is successful. A value of true indicates that the call is successful. A value of false indicates that the call has failed.
ErrorMessage String The error message returned when the call fails.
Code String For error codes, see Error codes.

Examples

Request example

http://iot.cn-shanghai.aliyuncs.com/?Action=SetDeviceGroupTags
&GroupId=W16X8TvdosecZu91
&TagString=%5B%7B%22tagKey%22%3A%22sdfsd%22%2C%22tagValue%22%3A%22%E6%98%AF%E9%9D%9E%E5%BE%97%E5%A4%B1%22%7D%5D
&Common request parameters

Response example

  • JSON format
    {
        "RequestId":"12CFDAF1-99D9-42E0-8C2F-F281DA5E8953",
        "Success":true
    }
  • XML format
    <? xml version="1.0" encoding="UTF-8" ? >
    <SetDeviceGroupTagsResponse>
    	<RequestId>12CFDAF1-99D9-42E0-8C2F-F281DA5E8953</RequestId>
    	<Success>true</Success>
    </SetDeviceGroupTagsResponse>