Petabox
  • Introduction
  • Petabox FAQ
  • Concepts
    • Bucket versioning
    • Logging actions with a bucket
    • Object Lock
  • Tools
    • Supported tools
      • CyberDuck S3 Client
      • Mountain Duck
      • S3 Browser
      • RClone
      • AWS CLI Console client
      • SDKs for different languages
        • JavaScript SDK
        • AWS SDK for Java
        • Python SDK (boto)
  • S3 Compatible API
    • How to use the API
    • Signing Requests
    • API Reference
      • Bucket
        • HeadBucket
        • ListObjects/ListObjectsV2
        • PutBucketVersioning
        • PutBucketLogging
        • ListBuckets
        • RenameBucket
        • GetBucketLocation
      • Object
        • PutObject
        • GetObject
        • HeadObject
        • RenameObject
        • PutObjectAcl
      • Multipart upload
        • General multipart upload order
        • CreateMultipartUpload
        • UploadPart
        • CompleteMultipartUpload
        • ListMultipartUploads
      • Analytics
        • GetStatistics
        • GetBandwidthAnalytics
        • GetStorageAnalytics
      • Common request headers
      • Common response headers
      • Responses
      • GetObjectTagging
      • GetObjectAcl
      • GetBucketAcl
      • ListObjectVersions
      • GetBucketRequestPayment
      • GetBucketReplication
      • GetBucketTagging
      • GetBucketLocation
      • GetBucketVersioning
      • GetBucketLifecycle
      • GetObjectLockConfiguration
      • PutObjectLockConfiguration
      • GetObjectRetention
      • GetObjectLegalHold
      • PutObjectRetention
      • PutObjectLegalHold
      • PutObjectAcl
      • PutBucketAcl
      • PutBucketVersioning
      • CopyObject
      • DeleteObjects
      • AbortMultipartUpload
      • DeleteObject
      • DeleteBucket
      • PutBucketTagging
      • PutObjectTagging
      • DeleteBucketTagging
      • DeleteObjectTagging
      • PutBucketLogging
      • GetBucketLogging
      • ListParts
      • UploadPartCopy
      • PutBucketPolicy
      • GetBucketPolicy
      • DeleteBucketPolicy
Powered by GitBook
On this page
  • Request Syntax
  • URI Request Parameters
  • Request Body
  • Response Syntax
  • Response Elements
  • Examples
  1. S3 Compatible API
  2. API Reference

GetObjectTagging

Returns the tag-set of an object. You send the GET request against the tagging subresource associated with the object

To use this operation, you must have permission to perform the s3:GetObjectTagging action. By default, the GET action returns information about current version of an object. For a versioned bucket, you can have multiple versions of an object in your bucket. To retrieve tags of any other version, use the versionId query parameter. You also need permission for the s3:GetObjectVersionTagging action.

By default, the bucket owner has this permission and can grant this permission to others.

Request Syntax

GET /{Key+}?tagging&versionId=VersionId HTTP/1.1
Host: Bucket.s3.petabox.io
x-amz-expected-bucket-owner: ExpectedBucketOwner
x-amz-request-payer: RequestPayer

URI Request Parameters

The request uses the following URI parameters.

Bucket

The bucket name containing the object for which to get the tagging information.

Required: Yes

Key

Object key for which to get the tagging information.

Length Constraints: Minimum length of 1.

Required: Yes

versionId

The versionId of the object for which to get the tagging information.

x-amz-expected-bucket-owner

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

x-amz-request-payer

Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests.

Valid Values: requester

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200
x-amz-version-id: VersionId
<?xml version="1.0" encoding="UTF-8"?>
<Tagging>
   <TagSet>
      <Tag>
         <Key>string</Key>
         <Value>string</Value>
      </Tag>
   </TagSet>
</Tagging>

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The response returns the following HTTP headers.

x-amz-version-id

The versionId of the object for which you got the tagging information.

The following data is returned in XML format by the service.

Tagging

Root level tag for the Tagging parameters.

Required: Yes.

TagSet

Contains the tag set.

Type: Array of Tag data types.

Examples

Sample Request

The following request returns the tag set of the specified object.

GET /petaboxexample-object?tagging HTTP/1.1
Host: petaboxexamplebucket.s3.<Region>.petabox.io
Date: Thu, 22 Sep 2016 21:33:08 GMT
Authorization: authorization string        

Sample Response

This example illustrates one usage of GetObjectTagging.

HTTP/1.1 200 OK
Date: Thu, 22 Sep 2016 21:33:08 GMT
Connection: close
Server: Petabox
<?xml version="1.0" encoding="UTF-8"?>
<Tagging xmlns="http://s3.petabox.io/doc/2006-03-01/">
   <TagSet>
     <Tag>
       <Key>tag1</Key>
       <Value>val1</Value>
   </Tag>
   <Tag>
        <Key>tag2</Key>
        <Value>val2</Value>
    </Tag>
  </TagSet>
 </Tagging>       
PreviousResponsesNextGetObjectAcl

Last updated 2 years ago