SurveyResponse Sub-Object v5

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 (excludes Deleted responses). View Example Return.

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

Note: Get requests will cache for 60 seconds. If you make repeated API get requests that are identical, the return will be cached and will thus return identical results.
ParametersExampleRequired
Authentication Credentialsapi_token=abcd12345&api_token_secret=abcd12345
True
page
page=3False
resultsperpage
resultsperpage=100False
filters
filter[field][0]=status&filter[operator][0]==&filter[value][0]=CompleteFalse

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

https://restapi.surveygizmo.com/v5/survey/123456/surveyresponse/121

Note: Get requests will cache for 60 seconds. If you make repeated API get requests that are identical, the return will be cached and will thus return identical results.
ParametersExampleRequired
Authentication Credentialsapi_token=12345&api_token_secret=12345True

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

https://restapi.surveygizmo.com/v5/survey/123456/surveyresponse?_method=PUT

ParametersExampleRequired
Authentication Credentialsapi_token=abcd12345&api_token_secret=abcd12345
True
statusComplete, Partial, DisqualifiedFalse
data[ID][option SKU]
(Populate a select question using ID)
data[1][10001]=Yes (Option title or Reporting value)False1
data[ID][value]
(Populate an open-text question)
data[1][value]=Response textFalse
data[ID][option SKU-other]
(Populate other text field)
data[1][10005-other]=Response textFalse
data[ID][comment]
(Populate comment field)
data[1][comment]=Response textFalse
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 textFalse

*Shortname is case sensitive

1While no specific data parameter is required, at least one data parameter must be passed in when creating/updating a response.

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

https://restapi.surveygizmo.com/v5/survey/123456/surveyresponse/121?_method=POST

ParametersExampleRequired
Authentication Credentialsapi_token=abcd12345&api_token_secret=abcd12345
True
statusComplete, Partial, DisqualifiedFalse
data[ID][option SKU]
(Update a select question using ID)
data[1][10001]=Yes (Option title or Reporting value)False1
data[ID][value]
(Update an open-text question)
data[1][value]=Response textFalse
data[ID][option SKU-other]
(Update other text field)
data[1][10005-other]=Response textFalse
data[ID][comment]
(Update comment field)
data[1][comment]=Response textFalse
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

1While no specific data parameter is required, at least one data parameter must be passed in when creating/updating a response.

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

https://restapi.surveygizmo.com/v5/survey/123456/surveyresponse/121?_method=DELETE

ParametersExampleRequired
Authentication Credentialsapi_token=abcd12345&api_token_secret=abcd12345
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 FieldsExampleAssociated 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)date_submittedsurveyresponse
Is Test Datais_test_datasurveyresponse
Contact ID (v4 API only)contact_idsurveyresponse
Statusstatussurveyresponse, survey, surveycampaign

*URL Encode the square brackets and the double quotes.

Operators

OperationSyntaxRequires 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 BlankIS NOT NULLFalse
Is Not Answered / Is BlankIS NULLFalse
In Comma Separated ListinTrue

Filtering Examples

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

https://restapi.surveygizmo.com/v5/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/v5/survey/123456/surveyresponse?filter[field][0]=date_submitted&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.

ParameterExampleAssociated Objects
pagepage=3surveyresponse, 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/v5/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/v5/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/v5/survey/123456/surveyresponse?page=3&resultsperpage=100