S3 List Objects V2
  • 31 May 2023
  • Dark
    Light

S3 List Objects V2

  • Dark
    Light

Article summary

GEThttps://s3.<your-region>.backblazeb2.com/<your-bucket-name>/?list-type=2

Returns a list of up to 1,000 objects in the bucket, sorted alphabetically by key.

Use the query parameters to filter the search.

By default, sets of up to 1,000 results are returned. You can set the max-keys to set the maximum result set size to less than 1,000. If the search results in more than the maximum result set size, then the first set is returned in the initial response, the <IsTruncated> response element contains the value true and the <NextContinuationToken> element contains a token to retrieve the next set of results. Use this token as the continuation-token query parameter in another request to retrieve the next set of results.

AUTHORIZATION AWS Signature

This request is using AWS Signature from collection Backblaze B2 Cloud Storage S3 Compatible API.

PARAMS

list-type

2

Must be set to 2 for V2 object list

continuation-token

Optional. Continuation token returned by a previous request.

delimiter

Optional. The delimiter is used to group keys.

encoding-type

Optional. Specifies an encoding method to use for characters that are not supported in XML 1.0.

fetch-owner

Optional. Set to 'true' to return the owner with each key.

max-keys

Optional. The maximum number of keys that should be returned.

prefix

Optional. Limit response to keys with this prefix.

start-after

Optional. B2 will start listing after this key.

PATH VARIABLES

bucket

Required. The name of the bucket

Example Request

curl --location 'https://s3.<your-region>.backblazeb2.com/my-bucket-name/?list-type=2'

Example Response

200 OK

Body

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Contents>
        <ETag>"85f30635602dc09bd85957a6e82a2c21"</ETag>
        <Key>object-1</Key>
        <LastModified>2022-01-28T23:24:07.000Z</LastModified>
        <Size>11</Size>
        <StorageClass>STANDARD</StorageClass>
    </Contents>
    <Contents>
        <ETag>"85f30635602dc09bd85957a6e82a2c21"</ETag>
        <Key>object-2</Key>
        <LastModified>2022-01-28T23:25:45.000Z</LastModified>
        <Size>11</Size>
        <StorageClass>STANDARD</StorageClass>
    </Contents>
    <Contents>
        <ETag>"3729bf569924c845dfe90bfe6281a9ff-1"</ETag>
        <Key>object-3</Key>
        <LastModified>2022-01-28T23:27:20.000Z</LastModified>
        <Size>11</Size>
        <StorageClass>STANDARD</StorageClass>
    </Contents>
    <IsTruncated>false</IsTruncated>
    <MaxKeys>1000</MaxKeys>
    <Name>my-bucket-name</Name>
    <Prefix></Prefix>
    <KeyCount>3</KeyCount>
</ListBucketResult>


Headers (8)

x-amz-request-id699c79d678ac85eb

x-amz-id-2

aMb41pGbJOWYzrTUIY0JmFjSgZMljS2L4

Cache-Control

max-age=0, no-cache, no-store

Content-Type

application/xml

Content-Length

1042

Date

Fri, 28 Jan 2022 22:46:26 GMT

Keep-Alive

timeout=5

Connection

keep-alive







Was this article helpful?