Get a survey for a conversation

Hi,

I was going through the API explorer and found an API that I cant seem to find by using the PureCloudPlatformClient.

I have surveyIds but id like to loop through them to get scores.

Where can I find example code like this link?
https://developer.genesys.cloud/api/rest/client-libraries/python/AnalyticsApi#---surveyaggregatequeryresponse----surveyaggregatequeryresponse-html--post-analytics-surveys-aggregates-query-body-

What sort of sample code are you looking for? There's an example showing the SDK usage at the link you shared.

Im trying to look for the specific part where I can get a survey for a conversation - the specific function used for that.

Bumping this...not sure if what Im asking for is clear

Hello,

You can use GET /api/v2/quality/surveys/{surveyId} to retrieve the Survey Responses.
In Python SDK, it is the get_quality_survey function

The surveyId appears in the Conversation Details (retrieving conversation details using conversationId or using a query for conversation details).

If the customer starts to answer and save (surveyStatus = InProgress) or if the customer submits/completes the survey (surveyStatus = Finished), the answers will be provided in the response to the GET /api/v2/quality/surveys/{surveyId}
The survey status (status attribute) is also provided in the response to GET /api/v2/quality/surveys/{surveyId}.

Regards,

Hi Jerome, thank you for the response, looks like that worked.

1 more question: How can I (or best easiest way) take this class PureCloudPlatformClientV2.models.survey.Survey and change it to json so I can break it down better?

I don't practice python much - usually nodejs.
But I think there is a to_json() method on all objects in the API.
I mean:
api_response = api_instance.get_quality_survey(......)
--> api_response.to_json()

Regards,

Got it thank you Jerome, I got it into a string and can take it from there.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.