Querying the Bucket List

Last Updated At: 2025-10-21 09:10:00

Description

The GET Service API is used to query the list of all buckets under a requester's account.

Request

Request Example

GET / HTTP/1.1
Host: <Endpoint>
Date: GMT Date
Authorization: Auth String

Authorization: Auth String (See Request Signature for details.)

Host: To query the list of buckets in a specified region

Request Header

Common Headers

This request uses common request headers. For details, see Common Request Headers.

Non-common Headers

This request has no special request header information.

Request Body

The request body of this request is empty.

Response

Response Headers

Common Response Headers

This response uses common response headers. For details, see Common Response Headers.

Special Response Headers

This request has no special response header information.

Response Body

A successful query returns application/xml data that includes the object information in the bucket.

<?xml version="1.0" encoding="UTF-8" ?>
<ListAllMyBucketsResult>
  <Owner>
    <ID>string</ID>
    <DisplayName>string</DisplayName>
  </Owner>
  <Buckets>
    <Bucket>
      <Name>string</Name>
      <Location>string</Location>
      <CreateDate>string</CreateDate>
    </Bucket>
    <Bucket>
      <Name>string</Name>
      <Location>string</Location>
      <CreateDate>string</CreateDate>
    </Bucket>
  </Buckets>
</ListAllMyBucketsResult>

The data are described as follows:

Node Name (Keyword) Parent Node Description Type Required
ListAllMyBucketsResult No Describes all the information of this response Container Yes

Content of the ListAllMyBucketsResult node of the container type:

Node Name (Keyword) Parent Node Description Type Required
Owner ListAllMyBucketsResult Describes bucket owner information Container Yes
Buckets ListAllMyBucketsResult Describes all bucket list information of this response Container Yes

Content of Owner:

Node Name (Keyword) Parent Node Description Type Required
ID ListAllMyBucketsResult.Owner ID of the bucket owner. string Yes
DisplayName ListAllMyBucketsResult.Owner Name of the bucket owner. string Yes

Content of the Buckets node of the container type:

Node Name (Keyword) Parent Node Description Type Required
Bucket ListAllMyBucketsResult.Buckets Single Bucket Information Container Yes

Content of the Bucket node of the container type:

Node Name (Keyword) Parent Node Description Type Required
Name ListAllMyBucketsResult.Buckets.Bucket Bucket string Yes
Location ListAllMyBucketsResult.Buckets.Bucket Region where the bucket is located. string Yes
CreateDate ListAllMyBucketsResult.Buckets.Bucket Bucket creation time in ISO 8601 format. Example: 2019-05-24T10:56:40Z. string Yes

Error Code

Error Code Description HTTP Status Code
InvalidBucketName The bucket name is invalid. 400 Bad Request
SignatureDoesNotMatch If this error code is returned, it means the provided signature is incorrect. 403 Forbidden
NoSuchBucket If this error code is returned, it means there is no such bucket. 404 Not Found

Practical Case

Request

GET / HTTP/1.1
Host: cos.city.yfm4.fsphere.cn
Date: Fri, 24 May 2019 11:59:51 GMT
Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1558699191;1558706391&q-key-time=1558699191;1558706391&q-header-list=date;host&q-url-param-list=&q-signature=c3f55f4ce2800fb343cf85ff536a9185a0c1****
Connection: close

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 495
Connection: close
Date: Fri, 24 May 2019 11:59:51 GMT
x-cos-request-id: NWNlN2RjYjdfZjhjODBiMDlfOWNlNF9hYzc2****

<ListAllMyBucketsResult>
    <Owner>
        <ID>qcs::cam::uin/100000000001:uin/100000000001</ID>
        <DisplayName>100000000001</DisplayName>
    </Owner>
    <Buckets>
        <Bucket>
            <Name>examplebucket1-1250000000</Name>
            <Location>city</Location>
            <CreationDate>2019-05-24T11:49:50Z</CreationDate>
        </Bucket>
        <Bucket>
            <Name>examplebucket2-1250000000</Name>
            <Location>city</Location>
            <CreationDate>2019-05-24T11:51:50Z</CreationDate>
        </Bucket>
    </Buckets>
</ListAllMyBucketsResult>