I’m building a real-time dashboard for a client that needs to show the Wrap-Up code as soon as an agent finishes a call. I’m using the GET /api/v2/analytics/conversations/{conversationId}/details endpoint, polling it when I detect the conversation has moved into the ACW state via the Notification API.
The issue: even when the agent has selected a wrap-up code and ‘Ended’ their ACW segment (visible in the Genesys UI), my API call often returns the conversation record with a null value for the wrap-up code in the agent’s participant segment. It sometimes takes 30-45 seconds for that field to populate in the Analytics record.
Is there a faster way to get the wrap-up code, or is this just the ‘standard’ analytics processing latency?
That’s standard. The Analytics Detail record is updated asynchronously. The ACW segment has to be fully ‘Closed’ in the database before the Analytics engine re-indexes the entire conversation to include the wrap-up code. Polling the Analytics API for real-time status is always going to have that lag.
If you need it ‘right now’, don’t use the Analytics API. Use the Notification API! Subscribe to v2.users.{userId}.conversations. When the agent submits the wrap-up code, you’ll get a final notification event for that conversation that includes the wrapup object directly in the participant section of the message body.
This is much faster than waiting for the Analytics engine. You’ll get the code within milliseconds of the agent clicking ‘Done’.
Coming from a PureConnect background, this was a big shift for me too. In PureConnect, the DB record was updated almost instantly. In GC, think of the Notification API as your ‘Real-Time’ source and the Analytics API as your ‘Historical’ source (where ‘Historical’ means anything older than 2 minutes).
One thing to note: if you use the Notification API, you’ll need to handle the state management yourself (mapping the User ID to the Conversation ID), but it’s the only way to get sub-second reporting on wrap-ups.