S3 get object attributes

Use the S3 GetObjectAttributes API to retrieve the metadata of an object without returning the object's data.

GetObjectAttributes API combines the functionality of HeadObject and ListParts . It provides all the information returned by these two calls in a single request, streamlining the process and reducing the number of API calls needed.
GET /BUCKET/OBJECT?attributes&versionId=VersionId
For example,
GET /testbucket/testobject?attributes&versionId=testversionid
Host: Bucket.s3.amazonaws.com
x-amz-max-parts: MaxParts
x-amz-part-number-marker: PartNumberMarker
x-amz-server-side-encryption-customer-algorithm: SSECustomerAlgorithm
x-amz-server-side-encryption-customer-key: SSECustomerKey
x-amz-server-side-encryption-customer-key-MD5: SSECustomerKeyMD5
x-amz-request-payer: RequestPayer
x-amz-expected-bucket-owner: ExpectedBucketOwner
x-amz-object-attributes: ObjectAttributes

The versionId subresource retrieves a particular version of the object.

Request entities

For example,
GET /testbucket?attributes&versionId=VersionId HTTP/1.1 
Host: Bucket.s3.amazonaws.com
x-amz-max-parts: MaxParts
x-amz-part-number-marker: PartNumberMarker
x-amz-server-side-encryption-customer-algorithm: SSECustomerAlgorithm
x-amz-server-side-encryption-customer-key: SSECustomerKey
x-amz-server-side-encryption-customer-key-MD5: SSECustomerKeyMD5
x-amz-request-payer: RequestPayer
x-amz-expected-bucket-owner: ExpectedBucketOwner
x-amz-object-attributes: ObjectAttributes

GET request headers

Table 1. GET response headers
Request header Description Type / Valid values Required?
Bucket The name of the bucket that contains the object. String Yes
Key The object key. String Yes
versionID The version ID used to reference a specific version of the object. String No
x-amz-max-parts Sets the maximum number of parts to return. String No
x-amz-object-attributes Specifies the fields at the root level that you want returned in the response. Fields that you do not specify are not returned. ETag | Checksum | ObjectParts | StorageClass | ObjectSize Yes
x-amz-part-number-marker Specifies the part after which listing should begin. Only parts with higher part numbers will be listed. String No

Response entities

For example,
HTTP/1.1 200
x-amz-delete-marker: DeleteMarker
Last-Modified: LastModified
x-amz-version-id: VersionId
x-amz-request-charged: RequestCharged
<?xml version="1.0" encoding="UTF-8"?>
<GetObjectAttributesOutput>
   <ETag>string</ETag>
   <Checksum>
      <ChecksumCRC32>string</ChecksumCRC32>
      <ChecksumCRC32C>string</ChecksumCRC32C>
      <ChecksumSHA1>string</ChecksumSHA1>
      <ChecksumSHA256>string</ChecksumSHA256>
   </Checksum>
   <ObjectParts>
      <IsTruncated>boolean</IsTruncated>
      <MaxParts>integer</MaxParts>
      <NextPartNumberMarker>integer</NextPartNumberMarker>
      <PartNumberMarker>integer</PartNumberMarker>
      <Part>
         <ChecksumCRC32>string</ChecksumCRC32>
         <ChecksumCRC32C>string</ChecksumCRC32C>
         <ChecksumSHA1>string</ChecksumSHA1>
         <ChecksumSHA256>string</ChecksumSHA256>
         <PartNumber>integer</PartNumber>
         <Size>long</Size>
      </Part>
      ...
      <PartsCount>integer</PartsCount>
   </ObjectParts>
   <StorageClass>string</StorageClass>
   <ObjectSize>long</ObjectSize>
</GetObjectAttributesOutput>

GET response headers

Table 2. GET response headers
Response header Description
last modified The creation date of the object
x-amz-delete-marker Specifies whether the object retrieved was (true) or was not (false) a delete marker. If false, this response header does not appear in the response
x-amz-request-charged If present, indicates that the requester was successfully charged for the request
x-amz-version-id The version ID of the object.
GetObjectAttributesOutput Root level tag for the GetObjectAttributesOutput parameters.
Checksum The checksum or digest of the object.
ChecksumCRC32 (string) The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part.
ChecksumCRC32C (string) The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part.
ChecksumSHA1 (string) The base64-encoded, 160-bit SHA-1 digest of the object. This will only be present if it was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part.
ChecksumSHA256 (string) The base64-encoded, 256-bit SHA-256 digest of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part.
Etag An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL.
ObjectParts A collection of parts associated with a multi-part upload.
Objectparts (structure) A collection of parts associated with a multipart upload.
TotalPartsCount (integer) The total number of parts.
PartNumberMarker (integer) The marker for the current part.
NextPartNumberMarker (integer) When a list is truncated, this element specifies the last part in the list, as well as the value to use for the PartNumberMarker request parameter in a subsequent request.
MaxParts (integer) The maximum number of parts allowed in the response.
IsTruncated (boolean) Indicates whether the returned list of parts is truncated. A value of true indicates that the list was truncated. A list can be truncated if the number of parts exceeds the limit returned in the MaxParts element.
Parts (list) A container for elements related to a particular part. A response can contain zero or more Parts elements.
Note:
  • General purpose buckets - For GetObjectAttributes , if an additional checksum (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , x-amz-checksum-sha1 , or x-amz-checksum-sha256 ) isn't applied to the object specified in the request, the response doesn't return Part.
  • Directory buckets - For GetObjectAttributes , no matter whether a additional checksum is applied to the object specified in the request, the response returns Part .
PartNumber (integer) The part number identifying the part. This value is a positive integer between 1 and 10,000.
Size (long) The size of the uploaded part in bytes.
ObjectSize The size of the object in bytes.
StorageClass Provides the storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects.