Call this operation to create tags for a specified product.
Limits
- You can call this operation to create up to 10 tags for a specified product at one time.
- Each product can have up to 100 tags.
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
Action | String | Yes | The operation that you want to perform. Value: CreateProductTags. |
ProductKey | String | Yes | The unique identifier of the product. |
ProductTags | List<ProductTag> | Yes | The list of tags to be created. A tag is represented by a pair of TagKey and TagValue,
which correspond to the key and value of the tag, respectively. For more information,
see ProductTag.
Note The tag keys must be unique within the product.
|
Common request parameters | N/A | Yes | See Common parameters. |
Parameter | Type | Required | Description |
---|---|---|---|
TagKey | String | Yes | The key of the tag, which can contain English letters, numbers and dots (.), and cannot exceed 30 characters in length. |
TagValue | String | Yes | The value of the tag, which can contain Chinese characters, English letters, numbers, hyphens (-), underscores (_), and dots (.), and cannot exceed 128 characters. A Chinese character is counted as two characters. |
Response parameters
Parameter | Type | Description |
---|---|---|
RequestId | String | The GUID 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 | The error code returned when the call fails. For more information about error codes, see Error codes. |
InvalidProductTags | List<ProductTag> | The list of invalid tags returned when the call fails. |
Examples
Sample request
https://iot.cn-shanghai.aliyuncs.com/&Action=CreateProductTags
&ProductKey=a1h7knJdld1
&ProductTag. 1. TagKey=first
&ProductTag. 1. TagValue=value1
&ProductTag. 2. TagKey=second
&ProductTag. 2. TagValue=value2
&Common request parameters
Sample response
JSON format
{
"RequestId": "354A4F9B-6B01-4498-8084-867F59720BA5",
"Success": true
}
XML format
<CreateProductTagsResponse>
<RequestId>57b144cf-09fc-4916-a272-a62902d5b207</RequestId>
<Success>true</Success>
</CreateProductTagsResponse>