I’m trying to send the 2nd GET message for A042 based off the Location returned in the OK 307 redirect message (seen below) but I’m getting an Access Denied error
*Ignore the FILEPATH key/value pair, that’s just where I want to download the attachment to.
I’m sending the X-Amz-Security-Token that was sent to me, within the 900 seconds that it says it expires after.
When calling GET A042, the API does not return the binary file directly. Instead, it returns a 307 Temporary Redirect with a Location header.
That Location header points to a pre-signed AWS S3 URL. The URL itself already contains all the required query needed to fetch the file.
Now, it seems like you are taking that URL apart into host/path/query and trying to add other values manually. This alters the signed URL, so the AWS signature no longer matches. Try to follow the Location header from the 307 response and perform a plain GET to that exact URL, unchanged.
You have to request the file, the exact same way it has been generated to you as it is a signed URL so there are strict rules on how these are used due to security.
I think the only one I’ve added is filepath that can be ignored, that’s just telling my system where to download the attachments to; I don’t think it should be sent out as part of the connection