You can call this operation to query the tags configured for a bucket.

Request syntax

GET /? tagging
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue

Response elements

Element Type Description
Tagging Container

The container that stores the returned tags of the bucket.

Parent node: None

Note If no tags are configured for the bucket, an XML message body is returned in which the Tagging element is empty.
TagSet Container

The container that stores the returned tags of the bucket.

Parent node: None

Tag Container

The container that stores a returned tag of the bucket.

Parent node: TagSet

Key String

The key of a tag.

Parent node: Tag

Value String

The value of a tag.

Parent node: Tag

Examples

  • Sample request
    GET /? tagging
    Host: oss-example.oss-cn-hangzhou.aliyuncs.com
    Date: Tue, 20 Dec 2018 13:09:13 GMT
    Authorization: OSS qn6qrrqxo2oawuk53otf****:ceOEyZavKY4QcjoUWYSpYbJ3****
  • Sample response
    200 (OK)
    content-length: 237
    server: AliyunOSS
    x-oss-request-id: 5C1B2D24B90AD5490CFE368E
    date: Thu, 20 Dec 2018 13:12:21 GMT
    content-type: application/xml
    <? xml version="1.0" encoding="UTF-8"? >
    <Tagging>
      <TagSet>
        <Tag>
          <Key>testa</Key>
          <Value>value1-test</Value>
        </Tag>
        <Tag>
          <Key>testb</Key>
          <Value>value2-test</Value>
        </Tag>
      </TagSet>
    </Tagging>

SDKs

The SDKs of the GetBucketTags operation for various programming languages are as follows:

Error codes

Error code HTTP status code Description
NoSuchBucket 404 The error message returned because the specified bucket does not exist.
AccessDenied 403 The error message returned because you have no permissions to query the tags configured for the bucket. Only the bucket owner can query the tags configured for a bucket.