How can I get list of files and file versions in a folder of s3 bucket using API?

0

I am trying to get list of files and file versions in a folder of s3 bucket by using API link by passing certain parameters I have refer this article: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions.html but not sure how i can create API link to get list of files file version as a response. thanks in advance

asked a year ago2317 views
2 Answers
0

Hi,

You could consider using AWS SDK for this use case as it would simplify your programming experience. There are few examples in the articles below which will help you understand how to list the S3 objects and its versions using the AWS SDK.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/example_s3_ListObjects_section.html https://docs.aws.amazon.com/AmazonS3/latest/userguide/example_s3_ListObjectVersions_section.html

Thanks

profile pictureAWS
Rama
answered a year ago
0

Here is how you do this in the AWS CLI:

aws s3api list-object-versions \
    --bucket _YOUR_BUCKET_NAME_ \
    --prefix _YOUR_FOLDER_NAME_ \
    --query Versions[*].[Key,VersionId]
profile pictureAWS
EXPERT
kentrad
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions