REST API Examples

Articles

Create a Table Question via the API
Did you know you can create a table question via the API?! You'll need a call to create the overall question and then a call for each row and column. Create the overall table question: https://restapi.surveygizmo.com/v5/survey/123456/surveypage/1/...
Create a Poll and Poll Answer Options
Some users have requested an example call for creating a poll using the REST API. The below call creates a survey object with type=poll . When creating a survey object with type=poll the polloptions array is required. In the below call we specif...
PHP: Build an Array of Response Data
Some users have requested example scripts to parse the basic survey response array into something more malleable for working with the data. The following example is very similar to code we use to organize survey data into an array that is easier to ...
PHP: OAuth Sample Code
The following code uses the OAuth Client library found here: (http://code.google.com/p/oauth-php/) -- but any library will work. /** * testapiAction * The following code tests the OAUTH authentication method of our API. * It uses the ...
Survey Contacts from an Existing Database
Pulling contacts from an existing database for the purposes of surveying or other otherwise gathering information is one of the most common uses of the SurveyGizmo API. In this use-case example we'll cover how to create a campaign, add contacts, and...
Create an Image Heatmap Question via API
Looking to create an Image Heatmap question via the API? You'll need use the surveyquestion and surveyoption endpoints to fully build out the question. 1. Create the Image Heatmap Question Start by creating the Image Heatmap question with the be...
Create a Text Highlighter Question via the API
Looking to create an Text Highlighter question via the API? You'll need use the surveyquestion and surveyoption endpoints to fully build out the question. 1. Create the Text Highlighter Question Start by creating the Text Highlighter question with...