Skip to main content

ListObjects

Returns some or all (up to 1000) of the objects in a bucket.

Description

Deprecated API

The ListObjects operation is maintained for backwards compatibility. For improved functionality and performance, we recommend using the ListObjectsV2 operation instead.

The ListObjects operation returns some or all (up to 1000) of the objects in a bucket. You can use the request parameters as selection criteria to return a subset of the objects in a bucket.

note
  • This operation returns up to 1000 objects at a time. Use the marker parameter for pagination.
  • For better performance when listing objects with many prefixes, consider using delimiter parameter.
  • If you need to list more than 1000 objects, you should use multiple requests with the marker parameter.

Request Syntax

GET /?delimiter=Delimiter&encoding-type=EncodingType&marker=Marker&max-keys=MaxKeys&prefix=Prefix HTTP/1.1
Host: BucketName.qstorage.quilibrium.com
x-amz-expected-bucket-owner: OwnerAccountId
Values in italics indicate user input and should be replaced with actual values.

This operation does not have a request body.

Request Parameters

URI Parameters

NameDescriptionRequiredType
delimiterA delimiter is a character you use to group keys. All keys that contain the same string between the prefix and the first occurrence of the delimiter are grouped under a single result element called CommonPrefixesNotext
encoding-typeEncoding type used by QStorage to encode object key names in the responseNotext
markerSpecifies the key to start with when listing objects in a bucketNotext
max-keysSets the maximum number of keys returned in the response bodyNonumber
prefixLimits the response to keys that begin with the specified prefixNotext

Headers

NameDescriptionRequiredType
x-amz-expected-bucket-ownerThe account ID of the expected bucket ownerNotext
x-amz-request-payerConfirms that the requester knows that they will be charged for the request.

Valid values: requester
Notext

Examples

Example 1: List objects in a bucket

GET / HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
x-amz-expected-bucket-owner: 123456789012
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Name>my-bucket</Name> <Prefix></Prefix> <Marker></Marker> <MaxKeys>1000</MaxKeys> <IsTruncated>false</IsTruncated> <Contents> <Key>example.txt</Key> <LastModified>2024-03-01T12:00:00.000Z</LastModified> <ETag>"d41d8cd98f00b204e9800998ecf8427e"</ETag> <Size>11</Size> <Owner> <ID>123456789012</ID> <DisplayName>user@example.com</DisplayName> </Owner> </Contents> </ListBucketResult>
Values in italics indicate variable response values.

Example 2: List objects with a prefix and delimiter

GET /?prefix=documents/&delimiter=/ HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
x-amz-expected-bucket-owner: 123456789012
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Name>my-bucket</Name> <Prefix>documents/</Prefix> <Marker></Marker> <MaxKeys>1000</MaxKeys> <Delimiter>/</Delimiter> <IsTruncated>false</IsTruncated> <Contents> <Key>documents/readme.txt</Key> <LastModified>2024-03-01T12:00:00.000Z</LastModified> <ETag>"d41d8cd98f00b204e9800998ecf8427e"</ETag> <Size>11</Size> <Owner> <ID>123456789012</ID> <DisplayName>user@example.com</DisplayName> </Owner> </Contents> <CommonPrefixes> <Prefix>documents/2024/</Prefix> </CommonPrefixes> </ListBucketResult>
Values in italics indicate variable response values.

Response Syntax

HTTP/1.1 200 OK
x-amz-id-2: RequestId
x-amz-request-id: AmazonRequestId
Date: ISO8601Date
<?xml version="1.0" encoding="UTF-8"?> <ListBucketResult> <Name>BucketName</Name> <Prefix>Prefix</Prefix> <Marker>Marker</Marker> <MaxKeys>MaxKeys</MaxKeys> <Delimiter>Delimiter</Delimiter> <IsTruncated>true|false</IsTruncated> <Contents> <Key>ObjectKey</Key> <LastModified>ISO8601Date</LastModified> <ETag>EntityTag</ETag> <Size>Size</Size> <Owner> <ID>ID</ID> <DisplayName>DisplayName</DisplayName> </Owner> </Contents> <CommonPrefixes> <Prefix>CommonPrefix</Prefix> </CommonPrefixes> </ListBucketResult>
Values in italics indicate variable response values.

Response Elements

Response Headers

NameDescriptionRequiredType
x-amz-id-2An identifier for the requestNoString
x-amz-request-idA unique identifier for the requestNoString
DateThe date and time at which the response was sentNoString

Response Body Elements

NameDescriptionRequiredType
ListBucketResultContainer for responseNoString
NameName of the bucketNoString
PrefixKeys that begin with the indicated prefixNoString
MarkerIndicates where in the bucket listing beginsNoString
NextMarkerWhen the response is truncated (the IsTruncated element value in the response is true), you can use the key name in this field as the marker parameter in the subsequent request to get the next set of objects. QStorage lists objects in alphabetical order.

Note: This element is returned only if you have the delimiter request parameter specified. If the response does not include the NextMarker element and it is truncated, you can use the value of the last Key element in the response as the marker parameter in the subsequent request to get the next set of object keys.
NoString
MaxKeysMaximum number of keys returned in the responseNoString
DelimiterCharacter that groups keys sharing the same string between the prefix and the first occurrence of the delimiter into a single CommonPrefixes element. These grouped keys are not returned elsewhere in the response. Each grouped result counts as only one return against the MaxKeys limit.NoString
IsTruncatedIndicates whether the returned list of objects is truncatedNoString
ContentsContains information about each Object returned. Each Object is returned as a Contents elementNoString
EncodingTypeEncoding type used by QStorage to encode object key names in the XML response. If specified in the request, this element is included in the response, and encoded key name values are returned in the following response elements: Delimiter, Marker, Prefix, Key, and NextMarker.NoString
CommonPrefixesContainer for keys that are grouped by common prefixes. Only appears when a delimiter is specified. Keys between Prefix and the next occurrence of the delimiter are grouped under a single CommonPrefixes element. These keys act like subdirectories in the directory specified by Prefix (e.g., with prefix 'notes/' and delimiter '/', 'notes/summer/' would be a common prefix). All keys rolled up into a common prefix count as a single return when calculating the number of returns against the 1,000 limit.NoString

Special Errors

Error CodeDescription
NoSuchBucketThe specified bucket does not exist
403Forbidden. Authentication failed or you do not have permission to list objects in the bucket

Permissions

You must have the s3:ListBucket permission.

Try It Out

Test ListObjects

List objects in a bucket.

Coming Soon

This feature is currently under development and will be available soon.

The following operations are related to ListObjects: