jelksnitis | 2016-08-16 15:41:07 UTC | #1
Hi,
We are attempting to process the records from a contact list by exporting the list and processing in code to export to external systems.
We are able to invoke the PostContactlistsContactlistIdExport(...) method successfully to initiate the export. After posting the export, we are able to retrieve a web URI using GetContactlistsContactlistIdExport(...). This is a fully formed web URI, that we can access via a browser and requires authentication. When we access the web URI in code, the retrieved web resource is the html for the authentication page, not the file.
Here are a few questions, the first being the most important for us:
- How do we expose a path from the GetContactlistsContactlistIdExport method or the PostContactlistsContactlistIdExport method that allows us to retrieve the file in code?
- What is the meaning of the "download" string parameter in the GetContactlistsContactlistIdExport(...) method? The documentation states "// string | Redirect to download uri (optional) (default to false)", we are not sure what the effect of specifying a value for this param is.
- Is there some latency between calling PostContactlistsContactlistIdExport(...) and GetContactlistsContactlistIdExport(...) that we need to be aware of?
- How long is an exported list persisted, will GetContactlistsContactlistIdExport(...) always return the latest version?
Any help would be much appreciated!
Thanks and regards, John E
tim.smith | 2016-08-16 16:23:49 UTC | #2
- Include the Authorization header with your bearer token in the request when accessing the download URI. You can get the auth token from the SDK via
ININ.PureCloudApi.Client.Configuration.Default.AccessToken. The format for the header is Authorization: bearer AccessToken. - It will redirect you to the download instead of giving you the prescribed response. Give it a try in postman. The SDK will choke on this because it's not getting the response it expected, however.
I'll pull someone in to answer 3 and 4.
jelksnitis | 2016-08-16 16:39:34 UTC | #3
Thanks Tim for the quick response.
- Adding the Authorization header using the AccessToken as specified worked and we are able to pull the file programmatically without issue.
- Re: "download" param, we'll check it out in postman, but just to clarify it sends back an HTTP redirect to the file instead of the file metadata. If it does not have relevance in the SDK implementation, then that is good to know!
Thanks, John
tim.smith | 2016-08-16 16:51:12 UTC | #4
Is there some latency between calling PostContactlistsContactlistIdExport(...) and GetContactlistsContactlistIdExport(...) that we need to be aware of?
Yes. When you call the GET method to get the download URI, it will return a 404 if there is no download URI available. That could be because you didn't export that contact list or because the file isn't ready. There is an upcoming notification topic for V2 that will notify you when the export is complete, but that's not available at the moment.
How long is an exported list persisted, will GetContactlistsContactlistIdExport(...) always return the latest version?
24 hours, and the file will not be updated automatically. The file is exported as a snapshot of when you made the POST export request. To get the latest list, you need to export again and get the new download URI.
Re: "download" param, we'll check it out in postman, but just to clarify it sends back an HTTP redirect to the file instead of the file metadata.
I checked the code and it does respond with a HTTP 307 to redirect to the download URI instead of the response defined in the docs.
system | 2017-08-28 19:26:30 UTC | #5
This post was migrated from the old Developer Forum.
ref: 301