I’m trying to build a custom dashboard in our Android app that shows CSAT scores directly on the conversation detail view. The goal is to pull survey responses from the Quality API and match them to the specific conversationId so we can display the score right next to the transcript.
The issue is the data model. When I query GET /api/v2/analytics/quality/surveys/summary, the response gives me aggregated stats. It doesn’t return the individual interaction IDs. I need the raw survey records to map them back.
I tried fetching the survey summaries, but there’s no field for conversationId or interactionId in the payload. Here’s a snippet of what I’m getting:
{
"results": [
{
"surveyId": "abc-123",
"surveyDefinitionId": "def-456",
"score": 5,
"submittedAt": "2023-10-27T14:30:00Z"
}
]
}
I dug through the docs for GET /api/v2/quality/surveys/{surveyId}, but that endpoint seems to return the survey definition content, not the response data. I’m stuck on how to bridge the gap between the survey response and the actual conversation.
Is there an endpoint I’m missing? Or do I have to query the conversations API and filter by surveyId if it exists? The GET /api/v2/conversations/webchat/{conversationId} endpoint has a surveys field, but that requires me to know the conversation ID first, which defeats the purpose of aggregating scores.
I’ve been hitting POST /api/v2/analytics/conversations/details/query with conversationType: webchat and trying to filter by surveyId, but the query builder doesn’t seem to support that field in the filterBy clause. I get a 400 Bad Request saying the property is invalid.
How are others handling this mapping? I don’t want to iterate through every conversation just to find the ones with surveys. That seems inefficient. Any code examples for the correct query structure would help.