Question:
I am using Postman to send the AWS S3 RestAPI “Get Bucket (Version 2)” to get bucket listing.
Name of bucket is “test-bucket-1.ahadomain.com” (ahadomain.com is a dummy nonexistent domain that I used when naming the bucket in aws). The user credentials I am using has all the permissions to make S3 calls. I am following the info on page – http://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html
I am using the endpoint : https://test-bucket-1.s3.us-east-1.amazonaws.com
I am sending the following Headers : Content-Type, Host, X-Amz-Content-Sha256, X-Amz-Date, Authorization
Do I need to add “list-type” as a query parameter or as a header? If as a query parameter, how do I state it in the url.
I am getting the following response, which does not contain a listing of the content, just info about the bucket itself:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Any help would be greatly appreciated.
Thank you,
Ahmed.
Answer:
You can do the following:
- Set the method to GET
- in the URL: https://s3.amazonaws.com/test-bucket-1.ahadomain.com/?list-type=2
Note: If the region of your bucket is not in us-east-1, change the s3.amazonaws.com to correct S3 endpoint of that region. - In Authorization tab, set the following:
a. Type: AWS Signature
b. AccessKey:
c. SecretKey:
d. AWS Region: us-east-1
Note: change this if this is not the region of your bucket
e. Service Name: s3
f. Check “Save helper data to request” - Go to Headers tab, delete all entries if there is any.
- Then click “Send” button