Skip to main content

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!
1 answer