Query the individual results of a survey via REST API

AndyMcAndyMc AustraliaCommunity Member - Trial User Qubie ✭

Query the individual results of a survey via REST API

I'm trying to understand how to query the individual results of a survey.

  • I configure an Event Subscription for "surveyengine.completedResponse.{SurveyID}".
  • Qualtrics sends a push notification to my server with the ResponseID and SurveyID each time {SurveyID} receives a response.
    How do I then get the data associated with that response? From reading the documentation making a request to https://yourdatacenterid.qualtrics.com/API/v3/responseexports will give me ALL responses - I just want the single response.

Best Answers

  • TomGTomG Raleigh, NC Wizard ✭✭✭✭✭
    Accepted Answer

    You've identified what I believe is a major outage in the version 3 API. I really don't understand what they are thinking. It is one of the most common uses of the API, but to do it in version 3 you have to jump through a bunch of hoops. You can determine a startDate before your response to filter the responses somewhat, then search through the results to find the actual response you are looking for.

    Or, you could use v2.5 of the API and use getLegacyResponseData. It will return the single response you are looking for.

    Qualtrics managed to change what was a relatively simple to program single API call in version 2.5 into a minimum of 3 API calls with a bunch programming around them in version 3.

  • Michael_Campbell_RedPepperMichael_Campbell_RedPepper Pleasant Grove, UT Sage ✭✭✭
    Accepted Answer

    @TomG, I fully agree with that statement. This is definitely one of the major gaps in the API.

    We had a hosted solution that did this, but it has to happen in 4 steps, using the 'Responses Export' functionality of the API here: https://api.qualtrics.com/docs/create-response-export

    1) You kick off the creation of the export with the call to https://yourdatacenterid.qualtrics.com/API/v3/responseexports, passing in the format you want it in, the surveyId you want exported, and filterable fields like StartDate, EndDate, Limit, etc.

    2) That will return an Export Status ID (ES_xxx..), to which you can send to the 'Get Response Export Progress' Endpoint here: https://yourdatacenterid.qualtrics.com/API/v3/responseexports/:responseExportId. That will give you the percentComplete of the progress,

    3) Then, once its finished, you call the 'Get Response Export File' Endpoint here: https://yourdatacenterid.qualtrics.com/API/v3/responseexports/:responseExportId/file.

    4) It will respond with a ZIP folder of all your responses. From there, you unzip, extract, and read the first row of the responses to get your data.

    That does seem like a lot, but we had a customer who's project required that exact solution. We were able to get that process down to less than 2 or 3 seconds at times.

Answers

Sign In to Comment