Queries the values of a specified tag key.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListTagValues

The operation that you want to perform. Set the value to ListTagValues.

Key String Yes k1

The tag key.

RegionId String Yes cn-hangzhou

The region ID of the resource.

NextToken String No caeba0bbb2be03f84eb48b699f0a****

The token used to start the next query.

PageSize Integer No 50

The number of tag values to return on each page.

Maximum value: 1000. Default value: 50.

ResourceType String No ALIYUN::ECS::INSTANCE

The type of the resource. For more information about supported resource types, see Types of resources that support tag API operations.

Response parameters

Parameter Type Example Description
NextToken String caeba0bbb2be03f84eb48b699f0a****

The token used to start the next query.

If the value of this parameter is empty, all results are returned.

RequestId String 8989CA7E-D2E0-4B6D-8282-311106E80150

The ID of the request.

Values List v1

The information of the tag values.

Examples

Sample requests

https://tag.aliyuncs.com/?Action=ListTagValues
&Key=k1
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<ListTagValuesResponse>
      <NextToken></NextToken>
      <RequestId>8989CA7E-D2E0-4B6D-8282-311106E80150</RequestId>
      <Values>
            <Value>v1</Value>
      </Values>
</ListTagValuesResponse>

JSON format

{
    "NextToken": "",
    "RequestId": "8989CA7E-D2E0-4B6D-8282-311106E80150",
    "Values": {
        "Value": [
            "v1"
        ]
    }
}

Error codes

HTTP status code Error code Error message Description
403 Invalid.NextToken The parameter NextToken is invalid. The error message returned because the value of the NextToken parameter is invalid.
404 Missing.TagKey Tag.N.Value has been specified and you must specify Tag.N.Key. The error message returned because the key of tag N is not specified.
404 MissingParameter.TagKey You must specify TagKey. The error message returned because the TagKey parameter is not specified.
403 NoPermission.Operator The user is not authorized to operate on the specified resource. The error message returned because you are not authorized to perform the operation.
403 NoPermissionKey.Operator You are not authorized to operate the tag key. The error message returned because you are not authorized to perform operations on the tag key.
403 InvalidParameter.ResourceType The ResourceType parameter is invalid. The error message returned because the value of the ResourceType parameter is invalid.
403 InvalidParameter.TagKey The Tag.N.Key parameter is invalid. The error message returned because the value of the TagKey parameter is invalid.

For a list of error codes, visit the API Error Center.