Trystan | 2022-09-07 06:43:16 UTC | #1
Hi,
I have been successfully using the endpoint
/api/v2/outbound/contactlists/{contactListId}/export
For initiating the export and then getting the download URI with POST & GET requests. I have also used the URI to download the file in the browser after signing in. The problem I am having is downloading the file using an Authorization header & bearer token. I can query all of the APIs using the Auth bearer token but not download the file given in the extract URI.
What are the authentication requirements for downloading such a file?
Thanks,
Trystan.
Jerome.Saint-Marc | 2022-09-07 08:35:58 UTC | #2
Hello,
You can find some information on this older post. The uri you get from GET /api/v2/outbound/contactlists/{contactListId}/export?download=false is not the url where the file is available/stored. This uri, that you will invoke with the Genesys Cloud Auth Bearer token, will give you back an amazon s3 url where the file is stored (Step 4 in the post reference above), with the AWS token being passed as query string parameter. This request (Step 5) to Amazon S3 MUST NOT be invoked with the Genesys Cloud Auth token (no Authorization header set on this request). When you invoke the downloadUri (Step 4), if you include ?issureRedirect=false, you will have a 200 OK with the Amazon S3 URL in the response body. If you don't include the issueRedirect query parameter, Genesys Cloud will return a 302 Redirect to the Amazon URL. Some http client stacks/libraries don't like the redirect, and keep the Authorization header set on the request to Amazon S3 URL - which triggers an error back from Amazon.
Regards,
Trystan | 2022-09-08 04:01:20 UTC | #3
Thanks, Jerome. I can download the file now.
John_Carnell | 2022-09-16 12:37:44 UTC | #4
This post was migrated from the old Developer Forum.
ref: 16179