function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hope E.Hope E. 

Get list of files from S3

Hi all, 

I need to convert some Json files stored on S3 to SF objects.

I've got these info from customer which I put in a named credential.

S3 Bucket - region eu-west-1
Bucket naam : 
    nonprd: nonProd
    key ID: keyId
    Access key: accessKey

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://nonProd.s3.eu-west-1.amazonaws.com/list-type=2');
request.setMethod('GET');
request.setHeader('Accept', 'text/plain');
request.setHeader('Content-Type', 'text/plain');  
HttpResponse response = http.send(request);
system.debug(response.getbody());

I'll receive a response 'The specified bucket does not exist'. Can anybody help with the solution please?

thanks!

SubratSubrat (Salesforce Developers) 
Hello Hope ,

I have came across a discusion which might help you with your ask.
Requesting you to please go through it -> https://salesforce.stackexchange.com/questions/31523/problem-to-run-amazon-web-service-s3-integration-code-supported-by-salesforce

If it helps please mark this as Best Answer.
Thank you.