Get Bucket Policy

Last updated:2021-04-28 10:59:35


This GET interface can get the BucketPolicy configuration of a Bucket.
If you want to use this interface, you need to be the owner of this Bucket.
If the interface is called successfully, it will return 200 and the configuration information of BucketPolicy; if you do not have permission to obtain BucketPolicy, it will return 403 Access Denied; if there is no BucketPolicy configuration, it will return 404 Policy Not Found.



GET /?policy HTTP/1.1
Host: {BucketName}.{endpoint}
Date: {date}
Authorization: {SignatureValue}


Request parameters

The interface does not use request parameters.

Request header

This interface only uses common request headers. For more information, please click Public request headers

Request content

A JSON string describing the bucket policy.

Response header

This interface can use all common response headers. For more information, please click Public response headers.

Response content

Bucketpolicy configuration information, string in JSON format.

Special errors

The interface does not return any special errors.


Request example

Authorization: authorization string
Date: Tue, 19 Jul 2016 09:12:54 GMT

Response example

When a Bucket Policy exists:

HTTP/1.1 200 OK
Content-Length: 232
Content-Type: application/json; charset=UTF-8
Date: Tue, 19 Jul 2016 09:25:29 GMT
Server: Tengine
X-Kss-Request-Id: 708e01a0b42642cd94611f33a2a96874

When Bucket Policy does not exist:

HTTP/1.1 404 Not Found
Content-Type: application/xml
Date: Tue, 19 Jul 2016 09:28:59 GMT
Server: Tengine
X-Kss-Request-Id: 1f807bb266854e4487ce27857001ba38
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Error><Code>NoSuchBucketPolicy</Code>
<Message>The bucket policy does not exist.</Message><Resource>/ks3-example/?policy</Resource>

Did you find the above information helpful?

Mostly Unhelpful
A little helpful
Very helpful

What might be the problems?

  • Insufficient
  • Outdated
  • Unclear or awkward
  • Redundant or clumsy
  • Lack of context for the complex system or functionality

More suggestions


Please give us your feedback.


Thank you for your feedback.