When I am trying to hit Genesys API's in AWS, I see some inconsistency in response. It seems I need to hit 4-5 times in order to download the file.
But when I try to hit the same API in my local environment, I am able to download the file. The following is error response from AWS:
I also assume that you are getting the HTTP 404 response when you call the second endpoint - i.e. GET /api/v2/outbound/contactlists/{contactListId}/export?download=false
Note that HTTP error response - like 404 - have a body that you should print in your logs as it usually gives a reason (error code).
In your case, I'd assume that the error code is "no.available.list.export.uri".
You can see this in the links to the REST API I included above (for the 404 on GET).
This happens because when you request to export a contact list, it will take time to prepare it and made it available via the download the service (download uri and AWS S3).
If the list is small, it is almost immediate.
If it is a long list, it will take time to have the export file ready and available.
When you request GET /api/v2/outbound/contactlists/{contactListId}/export?download=false and if the export is not available yet, you will get a 404 response. When the export is ready, you will get a 200 OK with the uri to download the export.
Hi Jerome,
Is it possible for Genesys to create an event, that indicates the extract is ready? or Another way to keep the extract prepared, before we call the API?
A scheduled lambda is planning to call the API on a schedule (every 15 min), but with some gap (5 min), between token generation and GET. This file is cumulative file and even with the gap it may cause problems and fail in real time.
Yes, there is an event via the Notifications API and the notifications service.
But as you are mentioning lambda - I assume you have a server-less model - I think it might be an odd approach to leverage (create and connect) a websocket from there (unless your lambda runs long enough to receive the notification via the web socket).
Through the Notifications API, you can request a channel, on which you will subscribe to a certain number of topics. On channel request, Genesys Cloud will provide you back with a websocket uri you have to connect to (and you need to maintain that websocket alive).
See here for the list of available topics.
The topic corresponding to the readiness of a contact list export is: v2.users.{id}.outbound.contactlists.{id}.export
If you have requested the export of a contact list using an access token related to a user context (OAuth with Implicit Grant or Authorization Code Grant or SAML2 Bearer Grant), the {id} for the user (v2.users.{id}.outbound.contactlists.{id}.export) corresponds to the userId who requested the export.
If you have requested the export of a contact list using an OAuth Client Credentials Grant token, the {id} will correspond to the clientId of your OAuth Client.
The second {id} (v2.users.{id}.outbound.contactlists.{id}.export) corresponds to the id of your contact list.
In the future, there will be another approach that can fit server-less models.
Genesys Cloud will support integration with AWS EventBridge. The notification events will then be sent to AWS EventBridge.
This capability is still in beta and has not been released yet.
Hi,
can you advise how much time would Genesys would take to prepare a specific size file , for instance how much time for a 20 as opposed to a 200 MB file.
For the request for Genesys to create an event, I would recommend you open an Idea in our [Ideas Portal]. Our product managers review this portal constantly and if this idea gets multiple votes it will make it onto our product roadmap.
Genesys Cloud operates using eventual consistency and asynchronous communication for process many of its workload types. We use DynamoDB, which leverages eventually consistency to help scale to a massive level. We also process many requests (like preparing an extract file) asynchronously. This can account for the delay. Giving exact estimates on how long it will take to prep a extract file can be a little tricky because some of that wait time can be driven by the volume of all customers being driven at that time.
I am going to pose your question to the Dev Team and see if they can provide additional guidance so you can better tune your code.
Thanks,
John Carnell
Manager, Developer Engagement
As Jerome mentioned, you can use subscribe to event published by Notification Service(uses web sockets). Our UI uses this mechanism. You can try this out with your lambda service even though it might be bit awkward with it being serverless. As he mentioned, in future, Genesys Cloud will support integration with AWS Eventbridge which would be better solution for using this service for lambdas.
You can also try polling GET in your lambda till a certain timeout or you get 200 response code.
In regards to your question on how much time it takes to download 20MB vs 200MB, it depends on the type of customer activity happening at any point of time in a region as John mentioned. For example, we downloaded this morning 275MB list in USW2 and it took roughly 7 minutes.