Linking Quality API CSAT responses to Interaction IDs for New Relic custom events

We are trying to build a custom New Relic dashboard that correlates Genesys Cloud Quality CSAT survey responses with the original interaction metadata. The goal is to ingest these as custom events in NRQL.

The issue is that the Quality API endpoints don’t seem to expose the interactionId directly in the survey response payload. When I query for survey responses, I get the surveyResponseId and score, but nothing that ties it back to the specific interaction record in the Analytics API.

Here is the Python code we are using to fetch the survey responses:

import requests
import json

headers = {
 'Authorization': f'Bearer {access_token}',
 'Content-Type': 'application/json'
}

url = "https://api.mypurecloud.com/api/v2/quality/surveys/responses"
params = {
 'pageSize': 100,
 'afterId': 'last_seen_id'
}

response = requests.get(url, headers=headers, params=params)
data = response.json()

for item in data['entities']:
 # item structure:
 # {
 # "id": "survey-response-uuid",
 # "score": 4.5,
 # "surveyId": "survey-uuid",
 # "evaluatorId": "agent-uuid",
 # "evaluatedEntityId": "interaction-uuid?" <-- THIS IS MISSING
 # }
 print(f"Survey: {item['id']}, Score: {item['score']}")

The evaluatedEntityId field is empty or null in the response. I expected this to contain the interaction ID so I could join it with the Analytics API data. Without this link, we can’t attribute the CSAT score to the specific call or chat session in our New Relic dashboards.

Here is what we have tried so far:

  • Checked the API documentation for /api/v2/quality/surveys/responses. It lists evaluatedEntityId as optional, but it’s always null for us.
  • Tried querying the Analytics API for interactions with a specific date range, but there is no surveyResponseId field in the interaction entity.
  • Looked into the Webhook events for quality:surveyResponseCreated, but the payload is identical to the REST API response.
  • Verified the OAuth token has the quality:responses:read scope.

Is there a different endpoint or a specific query parameter I am missing to get the interaction ID? Or is the only way to correlate this data by matching timestamps and agent IDs, which feels unreliable?

The Quality API docs are a bit thin on this. It doesn’t give you the interactionId in the survey response object directly. You have to bridge it via the conversation.

The survey response payload contains a conversationId. That’s your key. You’ll need to fetch the conversation details using that ID. The conversation object has the interactionId in its metadata.

Here is how I handle it in C# with the SDK. First get the survey, then the conversation.

var survey = await _qualityApi.GetQualitySurveyResponseAsync(surveyResponseId);
var conversationId = survey.Conversation.Id;

// Now fetch the conversation to get the interactionId
var conversation = await _conversationApi.GetConversationAsync(conversationId);
var interactionId = conversation.Interaction.Id;

It’s an extra API call, but it’s the only reliable way. Don’t try to parse the URL or guess. Just hit GET /api/v2/conversations/{id}. The response has interaction with the id you need for New Relic.

Make sure your API user has conversation:view scope. Otherwise you’ll get 403s on the second call.