Correlating CSAT survey responses with specific interactions using the Quality API in Go

Does anyone know the most efficient way to extract CSAT survey responses tied to specific interactions via the Quality API? I am building a Go service to aggregate quality metrics, and I need to link survey feedback directly to the underlying conversation data.

I have been using the /api/v2/quality/surveys endpoint to fetch survey data, but the response payload does not seem to include a direct reference to the interaction ID or conversation ID. Here is a snippet of how I am currently structuring the request in Go:

type SurveyRequest struct {
 InteractionType string `json:"interactionType"`
 DateFrom string `json:"dateFrom"`
 DateTo string `json:"dateTo"`
}

// ... HTTP client setup omitted for brevity ...

reqBody, _ := json.Marshal(SurveyRequest{
 InteractionType: "voice",
 DateFrom: "2023-10-01T00:00:00Z",
 DateTo: "2023-10-31T23:59:59Z",
})

resp, err := client.Post("https://api.mypurecloud.com/api/v2/quality/surveys", "application/json", reqBody)

The API returns a list of survey entities, but each entity only contains a surveyId and some metadata like createdDate. There is no conversationId or interactionId field that I can use to join this data with the analytics or conversation history endpoints. I have tried looking at the /api/v2/quality/evaluations endpoint, but that seems to focus on agent performance rather than customer satisfaction.

When I attempt to fetch individual survey details using the surveyId, I get a 404 error if I try to append it to the wrong path, or a 400 Bad Request if the structure is invalid.

Status: 400 Bad Request
Body: {"code":"bad.request","message":"The request body was not well-formed.","status":400}

Is there a specific query parameter or a different endpoint I should be using to get the interaction context for each survey response? I want to avoid making thousands of individual API calls to map surveys to conversations manually. Any insights on the correct data model or API path would be greatly appreciated.

It depends, but generally you must join survey data with interaction logs using the interactionId field from the Quality API. The /api/v2/quality/surveys response includes this identifier. Use it to query /api/v2/conversations/{id} for context. Always verify the survey timestamp aligns with the interaction end time to avoid mismatched data.