Feature Overview
This API is used to query the ACL of an object. To call this API, you need to have permission to read the ACL of the object.
Requests
Sample Request
GET /<ObjectKey>?acl HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth String
Note
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com, where <BucketName-APPID> is the bucket name with the APPID suffix, such as examplebucket-1250000000. You can refer to the Bucket Overview > Basic Information and Bucket Overview > Bucket Naming Convention documentation. <Region> represents the available regions for COS, which can be found in the Regions and Access Domain Names documentation.
Authorization: Auth String (For more information, see Request Signature.)
Request Parameters
This API has no request parameter.
Request Header
Request Body
This API does not have a request body.
Response
Response Header
Response Body
A successful query returns the application/xml data, which contains the object owner and authorization information.
<AccessControlPolicy><Owner><ID>string</ID><DisplayName>string</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI>string</URI></Grantee><Permission>Enum</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>string</ID><DisplayName>string</DisplayName></Grantee><Permission>Enum</Permission></Grant></AccessControlList></AccessControlPolicy>
The nodes are described as follows:
Node Name (Keyword) | Parent Node | Description | Local Disk Types |
AccessControlPolicy | - | Stores the result of GET Object acl. | Container |
Content of
AccessControlPolicy:Node Name (Keyword) | Parent Node | Description | Local Disk Types |
Owner | AccessControlPolicy | Information of the object owner. | Container |
AccessControlList | AccessControlPolicy | Information about the grantee and permissions. | Container |
Content of the Container node
AccessControlPolicy.Owner:Node Name (Keyword) | Parent Node | Description | Local Disk Types |
ID | AccessControlPolicy.Owner | The complete ID of the object owner, in the format qcs::cam::uin/[OwnerUin]:uin/[OwnerUin]For example, qcs::cam::uin/100000000001:uin/100000000001 | string |
DisplayName | AccessControlPolicy.Owner | Name of the object owner | string |
Content of the Container node
AccessControlPolicy.AccessControlList:Node Name (Keyword) | Parent Node | Description | Local Disk Types |
Grant | AccessControlPolicy.AccessControlList | A single permission | Container |
Content of the Container node
AccessControlPolicy.AccessControlList.Grant:Node Name (Keyword) | Parent Node | Description | Local Disk Types |
Grantee | AccessControlPolicy.AccessControlList.Grant | Grantee information, with xsi:type as either Group or CanonicalUser. When set to Group, the child node includes only URI. When set to CanonicalUser, the child node includes only ID and DisplayName. | Container |
Permission | AccessControlPolicy.AccessControlList.Grant | Granted permission information, please refer to the enumeration values in the ACL Overview document under the object operations section, such as READ, FULL_CONTROL, etc. | Enum |
Content of the Container node
AccessControlPolicy.AccessControlList.Grant.Grantee:Node Name (Keyword) | Parent Node | Description | Local Disk Types |
URI | AccessControlPolicy.AccessControlList.Grant.Grantee | For example, http://cam.qcloud.com/groups/global/AllUsers or http://cam.qcloud.com/groups/global/AuthenticatedUsers | string |
ID | AccessControlPolicy.AccessControlList.Grant.Grantee | The complete ID of the grantee, in the format qcs::cam::uin/[OwnerUin]:uin/[OwnerUin]For example, qcs::cam::uin/100000000001:uin/100000000001 | string |
DisplayName | AccessControlPolicy.AccessControlList.Grant.Grantee | Name of the grantee | string |
Error Codes
Examples
Requests
GET /exampleobject?acl HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Tue, 10 Sep 2019 08:29:26 GMTAuthorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1568104166;1568111366&q-key-time=1568104166;1568111366&q-header-list=date;host&q-url-param-list=acl&q-signature=***********************************************Connection: close
Response
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 742Connection: closeDate: Tue, 10 Sep 2019 08:29:26 GMTServer: tencent-cosx-cos-request-id: NWQ3NzVlZTZfYmIwMmEwOV83YTQ5XzEzNTcx****<AccessControlPolicy><Owner><ID>qcs::cam::uin/100000000001:uin/100000000001</ID><DisplayName>qcs::cam::uin/100000000001:uin/100000000001</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI>http://cam.qcloud.com/groups/global/AllUsers</URI></Grantee><Permission>READ</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>qcs::cam::uin/100000000002:uin/100000000002</ID><DisplayName>qcs::cam::uin/100000000002:uin/100000000002</DisplayName></Grantee><Permission>READ_ACP</Permission></Grant></AccessControlList></AccessControlPolicy>