ListObjectsV2
Lists the objects in a bucket, one page at a time.
/{bucket}?list-type=2Returns the current version of each object, in key order. Use prefix and delimiter to browse keys like folders.
- Role
- Viewer or higher
- Support
- Supported
- prefix, delimiter, continuation-token, start-after, max-keys, and encoding-type.
max-keyscounts the keys in Contents plus the common prefixes. A common prefix is one entry, however many keys it holds, and it appears on one page only.- Storage ignores
fetch-owner. Contents has no Owner.
Path parameters
The bucket name.
Query parameters
Send 2. It selects this operation.
Return only keys that start with this value.
Group the keys that contain this value after the prefix into CommonPrefixes. Usually /.
The most keys to return. Storage clamps the value to 1 through 1,000.
Default: 1000
The NextContinuationToken of the previous page. Send it to get the next page.
Return only keys after this key.
Send url to percent-encode the keys, prefixes, and delimiter in the response.
- url
- Percent-encode the values.
/stays as it is.
Headers
The workspace ID that must own the bucket. Another owner returns 403 AccessDenied.
Responses
200OK
One page of objects.
application/xml
The root element.
NamestringThe bucket name.
PrefixstringThe prefix of the request.
DelimiterstringThe delimiter of the request.
EncodingTypestringPresent when the request sent encoding-type.
KeyCountintegerThe number of Contents and CommonPrefixes elements.
MaxKeysintegerThe page size that storage used.
IsTruncatedbooleantrue when more keys follow.
NextContinuationTokenstringPresent when IsTruncated is true. Send it as continuation-token.
ContentsarrayOne element for each object.
CommonPrefixesarrayOne element for each group of keys.
Errors
Select an error in the response example to see its XML body. Any request can also get the common errors, such as SignatureDoesNotMatch.
- 404NoSuchBucket
No bucket has this name, or the bucket was deleted.
What to do: Check the bucket name. ListBuckets shows the buckets of the workspace.
- 403AccessDenied
The key does not have the role for this operation, or the bucket is in another workspace.
What to do: Use a key of the workspace that owns the bucket, with the role above.