Legacy Dev Forum Posts

 View Only

Sign Up

Get a survey for a conversation

  • 1.  Get a survey for a conversation

    Posted 06-05-2025 18:08

    XAaronYork | 2021-08-17 02:34:05 UTC | #1

    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-


    tim.smith | 2021-08-17 12:35:52 UTC | #2

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


    XAaronYork | 2021-08-17 16:05:19 UTC | #3

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


    XAaronYork | 2021-08-18 21:45:59 UTC | #4

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


    Jerome.Saint-Marc | 2021-08-19 07:09:47 UTC | #5

    Hello,

    You can use GET /api/v2/quality/surveys/{surveyId} to retrieve the Survey Responses. In Python SDK, it is the getqualitysurvey 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,


    XAaronYork | 2021-08-20 18:37:50 UTC | #6

    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?


    Jerome.Saint-Marc | 2021-08-20 18:37:50 UTC | #7

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

    Regards,


    XAaronYork | 2021-08-20 18:37:31 UTC | #8

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


    system | 2021-09-20 18:37:34 UTC | #9

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


    This post was migrated from the old Developer Forum.

    ref: 11754