I have been trying to build a report that links CSAT survey responses directly to the underlying interaction ID in Genesys Cloud. The goal is to pull the evaluation score and tie it back to the specific call or chat session. I am using the genesyscloud Python SDK to make these requests.
The documentation suggests that querying evaluations should return evaluations associated with interactions. I have the interaction IDs from our internal database, and I know the surveys were submitted because I can see them in the UI under the Quality section. However, when I attempt to query the API with the correct interactionId filter, I get an empty list back.
Here is the code snippet I am using:
from genesyscloud.rest import Configuration
from genesyscloud.quality_api import QualityApi
config = Configuration()
config.host = 'https://api.us.genesyscloud.com'
config.access_token = my_access_token
quality_api = QualityApi(Configuration(config))
# I know this interaction exists and has a CSAT result
interaction_id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
try:
# Note: There is no direct endpoint to query evaluations by interaction ID.
# The available endpoints are for scoring, updating, or retrieving specific evaluations by ID.
# To find evaluations for a specific interaction, you typically need to know the evaluation ID first
# or use the analytics aggregates query if you are looking for aggregate data.
# If you have the evaluation ID, you can retrieve it like this:
# evaluation_id = 'your-evaluation-id-here'
# resp = quality_api.get_quality_conversations_evaluation(
# conversation_id=interaction_id,
# evaluation_id=evaluation_id
# )
# print(f"Found evaluation: {resp.id}")
# For now, this is a placeholder as the direct query endpoint does not exist.
print("Direct query by interactionId is not supported via a single GET endpoint.")
except Exception as e:
print(f"Error: {e}")
The output is always an empty result or an error indicating the endpoint is not found. No error is thrown in the previous attempts, just an empty array or 404. I have verified that the interactionId is correct by checking the UI. I also tried filtering by type: survey but that did not change the result. Is there a specific permission I am missing on the OAuth token, or is the interactionId field in the evaluation object different from the standard interaction ID? I have quality:evaluation:view and analytics:report:view scopes enabled.