Hey everyone, I’m trying to build a script that pulls CSAT survey results and ties them back to specific conversation IDs in Genesys Cloud. The goal is to flag conversations where the score was low so we can review the recording later.
I’m using the Python SDK genesyscloud.quality module. I can successfully fetch the survey questions using api.get_survey_question(), but when I try to get the responses, I’m hitting a wall. The documentation for retrieving surveys mentions filtering by conversation, but I’m not sure if that’s the right endpoint for CSAT specifically, or if I need to use a different endpoint.
Here’s the code snippet I’m working with:
from genesyscloud.quality import quality_api_client
client = quality_api_client.create_quality_api()
# Trying to fetch surveys linked to a specific conversation
surveys = client.get_quality_conversations_surveys(
conversation_id='conv-12345-abcde'
)
print(surveys.entities)
The response comes back with a 200 OK status, but the entities array is always empty [], even though I know for a fact that a CSAT survey was submitted for that conversation ID. I’ve double-checked the conversation ID format and it looks correct. I’m also getting the same result if I try to filter by survey_id instead.
Is there a specific query parameter I’m missing? Or maybe the data isn’t indexed yet? I’ve waited a few hours after the survey submission. I’m running this in a local Python 3.9 environment with the latest SDK version.
I’ve also tried using the raw HTTP client to hit the endpoint directly:
GET /api/v2/quality/conversations/conv-12345-abcde/surveys
Same result. Empty entities. I’m wondering if the data is stored under a different identifier or if I need to pass a different parameter. Any pointers on how to correctly link these two data points would be great. I’m feeling a bit stuck on this one.