HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/doc/awscli/examples/s3api/get-object-tagging.rst
**To retrieve the tags attached to an object**

The following ``get-object-tagging`` example retrieves the values for the specified key from the specified object. ::

    aws s3api get-object-tagging \
        --bucket my-bucket \
        --key doc1.rtf

Output::

    {
        "TagSet": [
            {
                "Value": "confidential",
                "Key": "designation"
            }
        ]
    }

The following ``get-object-tagging`` example tries to retrieve the tag sets of the object ``doc2.rtf``, which has no tags. ::

    aws s3api get-object-tagging \
        --bucket my-bucket \
        --key doc2.rtf

Output::

    {
        "TagSet": []
    }


The following ``get-object-tagging`` example retrieves the tag sets of the object ``doc3.rtf``, which has multiple tags. ::

    aws s3api get-object-tagging \
        --bucket my-bucket \
        --key doc3.rtf

Output::

    {
        "TagSet": [
            {
                "Value": "confidential",
                "Key": "designation"
            },
            {
                "Value": "finance",
                "Key": "department"
            },
            {
                "Value": "payroll",
                "Key": "team"
            }
        ]
    }