I am pulling detailed conversation data for a custom reporting dashboard using the C# SDK. The goal is to map every interaction to its specific wrap-up code for quality assurance metrics. The query runs without errors and returns the conversation list, but the WrapUpCode field is consistently null for every record.
I have verified that the agents are actually setting wrap-up codes. The data shows up fine in the standard Genesys Cloud reporting UI. This suggests the issue is with how the analytics API exposes this data or how I am requesting it.
Here is the C# code I am using to build the query:
var analyticsApi = new AnalyticsApi();
// Define the time window
var timeRange = new AnalyticsTimeRange();
timeRange.From = DateTime.UtcNow.AddDays(-1).ToString("o");
timeRange.To = DateTime.UtcNow.ToString("o");
// Build the detail query
var query = new AnalyticsQuery();
query.View = "detail/conversations/voice";
query.TimeRange = timeRange;
// Attempt to select the wrap-up code explicitly
var selectList = new List<string>();
selectList.Add("conversationId");
selectList.Add("wrapUpCode");
selectList.Add("wrapUpCodeText");
query.Select = selectList;
var response = await analyticsApi.PostAnalyticsDetailConversationsAsync(query);
The response object response is valid and has a 200 status. However, iterating through response.Body.Entities shows that entity.WrapUpCode is always null. Even entity.WrapUpCodeText is empty.
I tried removing the explicit Select list to return all fields, but the result is the same. The wrapUpCode property exists on the ConversationDetailEntity class in the SDK, so it should be populated if the data is available.
Is this a known limitation of the detail/conversations/voice view? Or am I missing a specific parameter in the query body to force the inclusion of wrap-up data? I checked the API documentation for POST /api/v2/analytics/detail/conversations but it does not explicitly mention restrictions on wrap-up codes. The docs say it returns “detailed conversation data” but do not list every available field.
I also tried querying the summary view instead, but that aggregates the data and I lose the individual conversation context I need. I need the line-item data.
Here is a sample of the JSON payload I am sending in the request body:
{
"view": "detail/conversations/voice",
"timeRange": {
"from": "2023-10-25T00:00:00Z",
"to": "2023-10-26T00:00:00Z"
},
"select": [
"conversationId",
"wrapUpCode",
"wrapUpCodeText"
]
}
And a snippet of the response entity:
{
"conversationId": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8",
"wrapUpCode": null,
"wrapUpCodeText": null,
"startTime": "2023-10-25T14:30:00Z",
"endTime": "2023-10-25T14:35:00Z"
}
I suspect the analytics API might not have real-time access to the wrap-up code because it is set after the conversation ends and there could be a processing delay. But I am querying data from yesterday, so it should be processed.
Has anyone successfully retrieved wrap-up codes via the analytics detail API? If not, what is the recommended workaround? I considered using the /api/v2/conversations endpoint to fetch each conversation individually and join the data, but that seems inefficient for large datasets. I am looking for a more scalable solution if one exists.