SurveyResponse Sub-Object

 Help Us Improve Our API Documentation!

We're beginning an initiative to improve our API docs. We would love your help!

Please take this quick 4-question survey to help us out! Thank you in advance for your time!

The following API calls are currently available for the SurveyResponse object:

For info on returned fields and example returns go to SurveyResponse Sub-Object Returned Fields.

GET LIST - Get a list of all of your survey responses. View Example Return.

https://restapi.surveygizmo.com/v4/survey/123456/surveyresponse

Filtering Your List

It is worth noting that the GET LIST will pull all responses regardless of the response status; this includes deleted responses. If you wish to exclude deleted responses you can filter your GET LIST like the below call. Learn more about

filtering.

https://restapi.surveygizmo.com/v4/survey/2013779/surveyresponse.debug?filter[field][0]=status&filter[operator][0]=!=&filter[value][0]=deleted
Parameters Example Required
Authentication Credentials api_token=E4F796932C2743FEBF150B421BE15EB9&api_token_secret=A9fGMkJ5pJF1k True
page page=3 False
resultsperpage resultsperpage=100 False
filters filter[field][0]=subtype&filter[operator][1]==&filter[value][1]=survey False

GET SURVEYRESPONSE - Get information about a specified survey response. View Example Return.

https://restapi.surveygizmo.com/v4/survey/123456/surveyresponse/121
Parameters Example Required
Authentication Credentials api_token=E4F796932C2743FEBF150B421BE15EB9&api_token_secret=A9fGMkJ5pJF1k True

CREATE SURVEYRESPONSE - Create a new survey response. View Example Return.

https://restapi.surveygizmo.com/v4/survey/123456/surveyresponse?_method=PUT
Parameters Example Required
Authentication Credentials api_token=E4F796932C2743FEBF150B421BE15EB9&api_token_secret=A9fGMkJ5pJF1k True
status Complete, Partial, Disqualified False
data[ID][option SKU]
(Populate a select question using ID)
data[1][10001]=Yes (Option title or Reporting value) False
data[ID][value]
(Populate an open-text question)
data[1][value]=Response text False
data[ID][option SKU-other]
(Populate other text field)
data[1][10005-other]=Response text False
data[ID][comment]
(Populate comment field)
data[1][comment]=Response text False
data[Shortname][option SKU]
(Populate a select question using Shortname)
data[Shortname*][10001]=Yes (Option title or Reporting value) False
data[Shortname][value]
(Populate an open-text question using Shortname)
data[Shortname*][value=Response text]
 
False
data[ID][option SKU-other] data[1][10005-other]=Response text False

*Shortname is case sensitive

Back to the Top

UPDATE SURVEYRESPONSE - Update a specified survey response. View Example Return.

https://restapi.surveygizmo.com/v4/survey/123456/surveyresponse/121?_method=POST
Parameters Example Required
Authentication Credentials api_token=E4F796932C2743FEBF150B421BE15EB9&api_token_secret=A9fGMkJ5pJF1k True
status Complete, Partial, Disqualified False
data[ID][option SKU]
(Update a select question using ID)
data[1][10001]=Yes (Option title or Reporting value) False
data[ID][value]
(Update an open-text question)
data[1][value]=Response text False
data[ID][option SKU-other]
(Update other text field)
data[1][10005-other]=Response text False
data[ID][comment]
(Update comment field)
data[1][comment]=Response text False
data[Shortname][option SKU]
(Update a select question using Shortname)
data[Shortname*][10001]=Yes (Option title or Reporting value) False
data[Shortname][value]
(Update an open-text question using Shortname)
data[Shortname*][value=Response text] False

*Shortname is case sensitive

DELETE SURVEYRESPONSE - Delete a specified surveyresponse. View Example Return.

https://restapi.surveygizmo.com/v4/survey/123456/surveyresponse/121?_method=DELETE
Parameters Example Required
Authentication Credentials api_token=E4F796932C2743FEBF150B421BE15EB9&api_token_secret=A9fGMkJ5pJF1k True

Filtering SurveyResponse Returns

When pulling surveyresponses it is fairly common to filter the responses that return. Below we cover filtering the surveyresponse object. Learn more about filtering other objects in our Filtering Tutorial.

Filtering can be used in conjunction with the GET method on the surveyresponse object. Filtering is not supported in the PUT, POST or DELETE methods.

Fields

Possible Fields Example Associated Objects
Question [question(2)] surveyresponse
Question Option [question(2), option(10001)] surveyresponse
URL Variable [url("variablename")]* surveyresponse
Date Submitted datesubmitted (EST/EDT or GMT -5/GMT -4) datesubmitted surveyresponse
Is Test Data istestdata surveyresponse
Contact ID (v4 API only) contact_id surveyresponse
Status status surveyresponse, survey, surveycampaign

*URL Encode the square brackets and the double quotes.

Operators

Operation Syntax Requires a Value
Is Equal To = True
Is Not Equal To <> or != True
Less Than or Equal To <= True
Greater Than or Equal To >= True
Is Answered / Is Not Blank IS NOT NULL False
Is Not Answered / Is Blank IS NULL False
In Comma Separated List in True

Filtering Examples

This query would return responses with question-id 2 answered yes.

https://restapi.surveygizmo.com/v4/survey/123456/surveyresponse?filter[field][0]=[question(2)]&filter[operator][0]==&filter[value][0]=yes

This query would return responses with submission times greater than or equal to 2011-02-23 13:23:28 and with the status of Complete.

https://restapi.surveygizmo.com/v4/survey/123456/surveyresponse?filter[field][0]=datesubmitted&filter[operator][0]=>=&filter[value][0]=2011-02-23+13:23:28&filter[field][1]=status&filter[operator][1]==&filter[value][1]=Complete

Browsing Survey Responses

Returns default to 50 results for page. Use the page and resultsperpage parameters to customize your return for these calls.

Parameter Example Associated Objects
page page=3 surveyresponse, survey, surveycampaign, surveyquestion, surveypage, contact
resultsperpage* resultsperpage=100 (max=500) surveyresponse, survey

*Note: The limit for resultsperpage is 500 (subject to change), if set over the limit it will default back to the limit.

Browsing Examples

To view a different page of results use the page parameter. The below call would return results 101-150 as results are displayed 50 per page.

https://restapi.surveygizmo.com/v4/survey/123456/surveyresponse?page=3

To view more results per page use the resultsperpage parameter. The below call would return results 1-100.

https://restapi.surveygizmo.com/v4/survey/123456/surveyresponse?resultsperpage=100

Use the page and resultsperpage parameters in conjunction. This below call would return results 201-300.

https://restapi.surveygizmo.com/v4/survey/123456/surveyresponse?page=3&resultsperpage=100