Could someone explain the correct way to link a CSAT survey response from the Quality API back to a specific web messaging interaction in React Native?
I am building a mobile app using the Genesys Cloud Guest API and Web Messaging SDK. The goal is to fetch CSAT scores associated with past conversations so I can display them in a history view. I have been trying to use the Quality API, specifically GET /api/v2/quality/evaluations, but the response structure is confusing.
Here are the steps to reproduce the issue:
I authenticate using a standard OAuth token with quality:evaluations:read scope.
I call GET /api/v2/quality/evaluations with a filter for interactionType=webchat and a date range.
The API returns a list of evaluations. Each object has an id and a score, but I need to find the corresponding conversation ID to match it with my local chat history.
The evaluation object contains an interaction field with an id, but this ID does not match the conversationId I receive from the WebSocket messages in the SDK.
I tried using GET /api/v2/quality/evaluations/{id} to get details, but it still doesn’t clearly map to the guest-side conversation ID.
Here is a sample of the JSON payload I am getting:
My local SDK state has conversations with IDs like conv-abc123. There is no obvious field in the Quality API response that links inter-67890 to conv-abc123.
Is there a specific endpoint or header I should be using to resolve this mapping? Or should I be using a different API entirely, like the Analytics or Conversations API, to get this data? The documentation seems to assume I am building an admin dashboard, not a guest-facing mobile app. I am stuck on this mapping logic.
Ah, yeah, this is a known issue… The Quality API is designed for agent performance management, not guest-facing history retrieval. Trying to join evaluations with web messaging conversations is architecturally wrong because the evaluation payload only contains the conversationId, and the Quality API does not expose the detailed message transcripts or guest PII required for a proper history view.
You should stop using the Quality API for this use case entirely. Instead, leverage the Conversations API which holds the authoritative record of the interaction. You need to fetch the conversation details first, then use the conversationId to retrieve the specific CSAT response if it was stored as a custom metric or via the Survey API endpoint.
Here is the correct flow using the JavaScript SDK:
import { platformClient } from '@genesyscloud/platform-client-sdk';
const conversationsApi = platformClient.conversationsApi;
const qualityApi = platformClient.qualityApi;
// 1. Get conversation details to confirm it's a web messaging interaction
const convResponse = await conversationsApi.getConversationWebmessaging({
conversationId: 'your-conv-id'
});
// 2. If you need the CSAT score, check if it's linked in the conversation summary
// or use the Survey API if you have access to survey responses
const surveyApi = platformClient.surveyApi;
const surveyResponse = await surveyApi.getSurveyResponse({
surveyResponseId: 'linked-survey-id' // Usually found in conversation custom_attributes
});
console.log('CSAT Score:', surveyResponse.response.rating);
The key is that the conversationId is the bridge. Do not try to map evaluations. Use GET /api/v2/conversations/webmessaging/{conversationId} to get the metadata, then look for the surveyId in the response body. If you are using the Guest API, ensure your OAuth token has the conversations:view scope.
Verify OAuth scopes include conversations:view and surveys:read
Check the custom_attributes field in the conversation response for survey links
Use GET /api/v2/conversations/webmessaging/{conversationId}/messages for transcript history
Ensure the web messaging channel is configured to send surveys post-interaction
Make sure you stop trying to join evaluations with guest-facing history views. The Quality API is strictly for agent performance management. It does not expose the detailed message transcripts or guest PII required for a proper history view in your React Native app.
The suggestion above is correct. You need to pivot to the Conversations API. The conversationId is the only reliable key. You must fetch the conversation details and filter for web messaging interactions.
Authenticate using your OAuth client credentials. Ensure you have the conversation:view scope.
Fetch Conversation Details using the ID from your evaluation or history list.
Filter Media Type to webchat to isolate web messaging interactions.
Extract Metadata from the routingData or wrapupCode if CSAT was triggered via a custom flow, as the Quality API won’t give you the survey response payload directly for guests.
Here is the Python snippet using the genesys-cloud-python SDK to retrieve the conversation details:
from platform_sdk_python import ApiClient, Configuration, ConversationsWebMessagingApi
# Initialize API client
configuration = Configuration()
configuration.access_token = '<YOUR_ACCESS_TOKEN>'
api_client = ApiClient(configuration)
web_messaging_api = ConversationsWebMessagingApi(api_client)
# Get conversation details
try:
# Replace with actual conversation ID
conversation_id = "abc-123-def"
response = web_messaging_api.get_conversation_web_messaging(conversation_id)
# Check media type and routing data
if response.media_type == "webchat":
print(f"Conversation ID: {response.id}")
print(f"Routing Data: {response.routing_data}")
# Inspect routing_data for custom attributes linked to CSAT
except Exception as e:
print(f"Error fetching conversation: {e}")
This approach avoids the architectural mismatch of using Quality APIs for guest data. It is cleaner and respects the division isolation filters.
This is caused by using the wrong endpoint for guest-facing data retrieval. The Quality API is strictly for agent performance metrics and lacks the necessary transcript data for a history view. Use the Conversations API instead: https://developer.genesys.cloud/apidocs/conversations
Make sure you pivot away from the Quality API entirely for this specific use case. The suggestion above correctly identifies that GET /api/v2/quality/evaluations is strictly for agent performance metrics and lacks the necessary transcript data or guest PII required for a comprehensive history view. Attempting to join evaluations with guest-facing history is architecturally inefficient and often results in incomplete data due to scope limitations on the conversationId.
Use the Conversations API to fetch the full interaction details.
Filter specifically for web messaging conversations using the correct media type.
Extract the conversationId and use it to retrieve associated metadata.
Here is the precise endpoint you need to implement in your React Native app: