Working on a Kotlin service to aggregate CSAT scores tied to specific conversation IDs. I’m trying to fetch survey data using the Quality API. The documentation suggests that survey results are linked to conversations, but I’m struggling to find the right endpoint to retrieve the actual survey response for a specific conversation.
I have valid conversation IDs from the Analytics API. When I attempt to retrieve survey data, I’m not getting the surveyResponse details I expect. The response JSON contains the conversationId, startTime, and endTime, but the survey response field is completely absent. Not even null. Just missing.
Here is the relevant part of the response payload I’m seeing:
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "messaging",
"conversationId": "conv-uuid-123",
"startTime": "2023-10-27T14:00:00.000Z",
"endTime": "2023-10-27T14:15:00.000Z",
"wrapupCode": "Resolved",
"agents": [
{
"id": "agent-uuid-456",
"name": "John Doe"
}
]
}
I checked the Genesys Cloud UI for that specific conversation. The CSAT survey was definitely sent and a score was recorded (4/5 stars). The survey is configured to be part of the quality evaluation.
My Kotlin code looks like this:
val qualityApi = QualityApi(config)
// Attempting to get surveys for the conversation
val surveys = qualityApi.getConversationSurveys(conversationId).execute()
val score = surveys.body?.firstOrNull()?.score // This crashes with NPE because the list is empty or score is missing
I tried adding query parameters like ?includeSurvey=true but that results in a 400 Bad Request. The API spec for the endpoint I’m using doesn’t list any optional query params for including survey data.
Is there a different endpoint I should be hitting? Or is there a delay before the survey response is linked to the conversation in the Quality API? I’ve waited 10 minutes after the conversation ended. Still no data.
Feels like the Analytics API and Quality API are out of sync on when survey data gets populated.