Bill Manville
Bill Manville

Reputation: 31

SurveyMonkey API v3 GET Responses fields

In my app I used the get_respondent_list API in API v2 to get an overview of the responses and to allow me to select those responses which were relevant to download in greater detail - fields of interest to me included date_modified, status .

I had hoped that /surveys/{ID}/responses would give a similar facility but all it returns for each response is href and id. The parameters of the call enable me to filter the list in various ways but I would need to make several calls to identify the different categories that I am interested in.

When I made a similar point about the survey list it turned out there was an incorrectly documented include parameter which I could use to get additional fields in the response. I tried that for /surveys/{id}/responses but that was rejected. Could such a facility be added?

If not I guess I will go for /surveys/{id}/responses/bulk and do all the work in the app.

Upvotes: 2

Views: 3216

Answers (2)

MajorBriggs
MajorBriggs

Reputation: 556

This wrapper for the API (not written by me) makes it fairly easy to get all the responses from a survey paired with the relevant question details.

In order to get the data structured in a way that resembles the output from the manual export, a bit of gymnastics is needed (I can recommend Pandas' .pivot_table(). Which columns that contain the actual answers vary depending on questions type, adding further complications depending on the complexity of the survey.

Upvotes: 0

Adam Klockars
Adam Klockars

Reputation: 301

The bulk endpoint is the correct choice. It is basically a call to /surveys/{ID}/responses with 'include' covering every field. The only downside is is the smaller maximum page size. Not sure sure what additional work you are referring to, since you would need to handle pagination at /surveys/{ID}/responses for more than 1000 responses, and all the fields you are looking for are available at the top level of the returned response dictionary.

Upvotes: 2

Related Questions