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://api.alchemer.com/v5/survey/123456/surveyresponse
Parameters | Example | Required |
---|---|---|
Authentication Credentials | api_token=abcd12345&api_token_secret=abcd12345 | True |
page | page=3 | False |
resultsperpage | resultsperpage=100 | False |
filters | filter[field][0]=status&filter[operator][0]==&filter[value][0]=Complete | False |
GET SURVEYRESPONSE - Get information about a specified survey response.
https://api.alchemer.com/v5/survey/123456/surveyresponse/121
Parameters | Example | Required |
---|---|---|
Authentication Credentials | api_token=12345&api_token_secret=12345 | True |
CREATE SURVEYRESPONSE - Create a new survey response.
Compatible Question Types
- Essay
- Slider
- Textboxes
- Date
- Number
- Radio Button Question Type
- Image Select (single)
- Dropdown Menu (single and multi-select)
- Checkbox Question Type
- Radio button Grid
- Checkbox Grid
- Continuous Sum
- Textbox Grid
- Textbox list
- Ranking Question Type
- Custom Group
https://api.alchemer.com/v5/survey/123456/surveyresponse?_method=PUT
While no specific data parameter is required, at least one data parameter must be passed in when creating/updating a response.
Parameters | Example | Required |
---|---|---|
Authentication Credentials | api_token=abcd12345&api_token_secret=abcd12345 | 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
**When populating a response for a checkbox question, if the reporting value includes a comma it must be URL encoded.
UPDATE SURVEYRESPONSE - Update a specified survey response.
Compatible Question Types
- Essay
- Slider
- Textboxes
- Date
- Number
- Radio Button Question Type
- Image Select (single)
- Dropdown Menu (single and multi-select)
- Checkbox Question Type
- Radio button Grid
- Checkbox Grid
- Continuous Sum
- Textbox Grid
- Textbox list
- Ranking Question Type
- Custom Group
https://api.alchemer.com/v5/survey/123456/surveyresponse/121?_method=POST
While no specific data parameter is required, at least one data parameter must be passed in when creating/updating a response.
Parameters | Example | Required |
---|---|---|
Authentication Credentials | api_token=abcd12345&api_token_secret=abcd12345 | 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
**When populating a response for a checkbox question, if the reporting value includes a comma it must be URL encoded.
DELETE SURVEYRESPONSE - Delete a specified surveyresponse.
https://api.alchemer.com/v5/survey/123456/surveyresponse/121?_method=DELETE
Parameters | Example | Required |
---|---|---|
Authentication Credentials | api_token=abcd12345&api_token_secret=abcd12345 | True |
Sorting and Filtering SurveyResponse Returns
When pulling surveyresponses it is fairly common to sort and filter the responses that return. Below we cover sorting and filtering the surveyresponse object. Learn more about filtering other objects in our Filtering Tutorial.
Sorting SurveyResponse Returns
The use of the order_by
parameter is restricted to only accept the following values:
date_submitted
(ascending order)-date_submitted
(descending order)
Filtering SurveyResponse Returns
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. Learn more about filtering other objects in our Filtering Tutorial.
Fields
Possible Fields | Example | Associated Objects |
---|---|---|
Question | [question(2)] | surveyresponse |
Question Option | [question(2), option(10001)] | surveyresponse |
URL Variable | [url("variablename")]* | surveyresponse |
Date Submitted (EST/EDT or GMT -5/GMT -4) | date_submitted | surveyresponse |
Is Test Data | is_test_data | 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 |
Greater Than | > | True |
Less Than | < | 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://api.alchemer.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://api.alchemer.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.
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://api.alchemer.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://api.alchemer.com/v5/survey/123456/surveyresponse?resultsperpage=100
Use the page and resultsperpage parameters in conjunction. This below call would return results 201-300.
https://api.alchemer.com/v5/survey/123456/surveyresponse?page=3&resultsperpage=100