So we’re trying to pull wrapup codes associated with completed conversations using the /api/v2/analytics/conversations/details endpoint, which should be straightforward, but it’s consistently returning null for the wrapup.code field. The query itself looks fine - basic filtering for completed conversations within the last 24 hours for a specific queue ID, and we’re including wrapup in the expand parameter. It’s not a permissions issue, the user has full access.
The thing is, if I go into the Architect flow associated with this queue, I can see that wrapup codes are being set on completed calls. The flow itself is pretty standard - a simple IVR with a transfer to a queue, then a wrapup selection. It’s not a complex routing setup and we’ve shipped flows like this a hundred times. We’re using genesyscloud-rest-sdk version 6.2.0. I’ve checked the response headers, no obvious CORS issues or anything like that.
Here’s the Python snippet used to make the request - it’s a fairly standard pagination loop, trying to get everything, but honestly the API pagination limits are still painful.
import requests
import json
base_url = "https://api.genesyscloud.com/api/v2/analytics/conversations/details"
queue_id = "YOUR_QUEUE_ID" # obviously replace this
start_date = "2024-01-01T00:00:00Z"
end_date = "2024-01-02T00:00:00Z"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN" # replace this
}
def get_conversation_details(page_size=100, page_number=1):
params = {
"queryType": "simple",
"query": f"queueId:\"{queue_id}\" AND startTime:>= \"{start_date}\" AND endTime:<= \"{end_date}\" AND conversationStatus:COMPLETED",
"expand": ["wrapup"],
"pageNumber": page_number,
"pageSize": page_size
}
response = requests.get(base_url, headers=headers, params=params)
response.raise_for_status()
return response.json()
all_conversations = []
page_number = 1
while True:
data = get_conversation_details(page_number=page_number)
if not data["results"]:
break
all_conversations.extend(data["results"])
page_number += 1
for conversation in all_conversations:
if conversation["wrapup"] is None:
print(f"Conversation ID {conversation['id']} has no wrapup code")
print(f"Total conversations: {len(all_conversations)}")
We’ve seen this happen intermittently with other queues too. Just trying to figure out why the API isn’t reflecting the wrapup codes that are clearly being recorded in the flow. It’s making dashboarding a pain. Move fast.