ListObjects/ListObjectsV2

Returns a list of objects in a bucket.

When issuing, pagination is used; in one request, you can get a list of no longer than 1000 objects. If there are more objects, then it is necessary to execute several queries in a row.

Note

This method has two versions.

  • listObjectsV2 - up-to-date version, more convenient to use.

  • listObjectsV1 - previous version.

To call both methods, the same is used URL, but it differs in the query parameter. To invoke listObjectsV2, use the parameter list-type=2.

listObjectsV2

Request

GET /{bucket}?list-type=2&continuation-token=ContinuationToken&delimiter=Delimiter&encoding-type=EncodingType&max-keys=MaxKeys&prefix=Prefix&start-after=StartAfter HTTP/1.1

Path parameters

Query parameters

All parameters listed in the table are optional.

Headings

Use only generic headers in your request .

Response

Headings

The response can only contain general headers .

Response codes

For a list of possible answers, see the Answers section .

The successful response contains additional data in XML format, the schema of which is described below.

Data schema

<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult>
   <IsTruncated>boolean</IsTruncated>
   <Contents>
      <ETag>string</ETag>
      <Key>string</Key>
      <LastModified>timestamp</LastModified>
      <Size>integer</Size>
      <StorageClass>string</StorageClass>
   </Contents>
   ...
   <Name>string</Name>
   <Prefix>string</Prefix>
   <Delimiter>string</Delimiter>
   <MaxKeys>integer</MaxKeys>
   <CommonPrefixes>
      <Prefix>string</Prefix>
   </CommonPrefixes>
   ...
   <EncodingType>string</EncodingType>
   <KeyCount>integer</KeyCount>
   <ContinuationToken>string</ContinuationToken>
   <NextContinuationToken>string</NextContinuationToken>
   <StartAfter>string</StartAfter>
</ListBucketResult>

ListObjects

Request

GET /{bucket}?delimiter=Delimiter&encoding-type=EncodingType&marker=Marker&max-keys=MaxKeys&prefix=Prefix HTTP/1.1

Path parameters

Query parameters

All parameters listed in the table are optional.

Headings

Use only generic headers in your request .

Response

Headings

The response can only contain general headers .

Response codes

For a list of possible answers, see the Answers section .

The successful response contains additional data in XML format, the schema of which is described below.

Data schema

<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult>
   <IsTruncated>boolean</IsTruncated>
   <Marker>string</Marker>
   <NextMarker>string</NextMarker>
   <Contents>
      <ETag>string</ETag>
      <Key>string</Key>
      <LastModified>timestamp</LastModified>
      <Size>integer</Size>
      <StorageClass>string</StorageClass>
   </Contents>
   ...
   <Name>string</Name>
   <Prefix>string</Prefix>
   <Delimiter>string</Delimiter>
   <MaxKeys>integer</MaxKeys>
   <CommonPrefixes>
      <Prefix>string</Prefix>
   </CommonPrefixes>
   ...
   <EncodingType>string</EncodingType>
</ListBucketResult>

Last updated