Skip to main content

GetObjectTagging

GetObjectTagging returns the tag set of an object. Objects on STRG carry no tags, so the answer is always an empty tag set. That keeps tools and SDKs which read object tags as part of their normal flow - backup and sync tools, infrastructure-as-code - working without any changes, and it matches DeleteObjectTagging, which always succeeds.

Good to know on STRG
  • Objects have no tags, so <TagSet> is always empty.
  • PutObjectTagging is answered with 501 NotImplemented, so a client knows straight away, and so is x-amz-tagging on an upload or a copy.
  • A bucket in another region answers 404 NoSuchBucket rather than a redirect: each bucket is reached through its own regional endpoint.
  • x-amz-expected-bucket-owner is welcome and has nothing to check: a key only ever reaches buckets of its own account.

When you'd use it​

  • Backup and sync tools. A tool copying objects from one store to another may read each object's tags so it can carry them along. On STRG it gets an empty tag set and copies the object as usual.
  • Infrastructure-as-code. Tools that compare an object with its description - content, metadata and tags - read the tags to see whether anything changed. An empty tag set matches a description that sets none, so the run carries on.
  • Scripts written for Amazon S3. A script that looks at an object's tags before deciding what to do with it keeps running unchanged, and finds no tags.

Request​

GET /photos/2024/cat.jpg?tagging HTTP/1.1
Host: my-bucket.s3.eu-central-1.strg.com
Authorization: AWS4-HMAC-SHA256 Credential=...
x-amz-date: 20260926T120000Z
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

The path-style form is GET /my-bucket/photos/2024/cat.jpg?tagging on s3.eu-central-1.strg.com, which is what a bucket name containing a dot needs - Addressing explains both.

Permissions​

The access key needs Read objects (objects:read). For a key limited to certain buckets or to an object prefix, the bucket and the object key need to fall within them. Access keys has the details.

URI parameters​

NameTypeRequiredDescription
BucketStringYesThe bucket containing the object.
KeyStringYesThe object key.
taggingFlagYesSelects this operation. Sent with no value.
versionIdStringNoThe version to read the tag set of. Its tag set is empty too.

Any other query parameter is answered with 501 NotImplemented.

Request headers​

NameTypeRequiredDescription
x-amz-expected-bucket-ownerStringNoWelcome, with nothing to check: an access key only ever reaches its own account's buckets.
x-amz-request-payerStringNoHas no effect: STRG has no Requester Pays buckets.

Request body​

None.

Response​

A successful request answers 200 OK with an XML body.

Response headers​

NameDescription
x-amz-version-idS3's header naming the version whose tag set was read. The tag set is empty whichever version it is.
x-amz-request-idThe request ID, handy for a support request.

Response body​

ElementTypeDescription
TaggingContainerThe root element.
TagSetContainerThe object's tags. Always empty on STRG.
<?xml version="1.0" encoding="UTF-8"?>
<Tagging xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<TagSet/>
</Tagging>

Errors​

These are the errors this request can return, and the situation behind each one.

CodeHTTP statusWhen
NoSuchBucket404The bucket does not exist, it is in a region other than the endpoint's, or the account has no storage in this endpoint's region.
AccessDenied403The access key lacks Read objects, the bucket or key is outside the key's buckets or object prefix, an x-amz-* header is not signed, or a presigned URL has expired.
InvalidAccessKeyId403The access key does not exist, has expired or been revoked - or it was created moments ago and is not usable yet in a region where the account already stores data, in which case the same request works shortly afterwards.
InvalidURI400The key contains a . or .. path segment.
SignatureDoesNotMatch403The request signature does not match.
RequestTimeTooSkewed403The request time is more than 15 minutes from the server's.
AuthorizationHeaderMalformed400The signature's credential scope names a region other than the endpoint's.
NotImplemented501The request carries a query parameter this operation does not use.
SlowDown503Too many requests. The Retry-After header says when a retry is welcome; the AWS SDKs retry on their own.
ServiceUnavailable503A temporary failure; the same request can be retried.

Differences from Amazon S3​

The table lists each place where STRG behaves differently, and what that means for a client.

AspectAmazon S3STRG
Object tagsStored and returnedObjects have no tags; <TagSet> is always empty
Setting tagsPutObjectTagging, or x-amz-tagging on PutObject, CopyObject and CreateMultipartUpload501 NotImplemented for each, so a client knows straight away
Bucket in another region301 redirect with x-amz-bucket-region404 NoSuchBucket. A bucket is reached through its own regional endpoint.
x-amz-expected-bucket-ownerChecked against the bucket ownerWelcome, with nothing to check

Examples​

aws s3api get-object-tagging \
--bucket my-bucket \
--key photos/2024/cat.jpg \
--endpoint-url https://s3.eu-central-1.strg.com \
--region eu-central-1

The output:

{
"TagSet": []
}
View as Markdown