You can call the TagResources operation to add a tag to a resource.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set this parameter to TagResources.
ResourceId.N String Yes The ID of the resource to add the tag to. Specify a CDN domain name as the resource ID. Valid values of N: 1 to 50.
ResourceType String Yes The resource type. Set this value to DOMAIN.
Tag.N.Key String Yes The key of the tag. Valid values of N: 1 to 20.
Tag.N.Value String No The value of the tag. Valid values of N: 1 to 20.

Examples

Sample request

https://cdn.aliyuncs.com/?Action=TagResoruces
&ResourceId. 1=example.com
&ResourceType=DOMAIN
&Tag. 1.Key=env
&Tag. 1.Value=''
&<Common request parameters>

Sample success response

JSON format

{
"RequestId":"97C68796-EB7F-4D41-9D5B-12B909D76508"
}