API: Questions and Location Tracking¶
Make sure to read the API Overview before reading this document.
Retrieving a List of Questions¶
Required Variables¶
| Variable | Description |
|---|---|
| section | Must be set to questions. |
| action | Must be set to retrieve. |
| api_key | Must be set to your unique API key. |
Optional Variables¶
| Variable | Description |
|---|---|
| question_id | An integer or series of integers which specifies the question IDs that you wish to include in the list. You can specify a single integer or a comma-separated list of integers (Examples: 1005 or 1005, 1010, 1254). You can also use the keyword all to include all questions. This parameter is set to all by default. |
Response¶
Example:
<?xml version="1.0" encoding="UTF-8"?>
<xml>
<status>1</status>
<count>1</count>
<question id="1">
<text>Would you like soda with your movie?</text>
<type>option</type>
<answer id="27">Yes</answer>
<answer id="28">No</answer>
</question>
</xml>
Creating a Question¶
Required Variables¶
| Variable | Description |
|---|---|
| section | Must be set to questions. |
| action | Must be set to create. |
| api_key | Must be set to your unique API key. |
| question_text | A string which specifies the text of your new question. |
Optional Variables¶
| Variable | Description |
|---|---|
| question_type | An enum type which specifies the type of question you want to create. If not specified the question type defaults to manual. See the list below for available question types. |
question_type List¶
Note: To make questions of certain types usable (e.g. checkbox, dropdown, webcollect), you must use the question id returned in the result to add answer option(s) to your question.
checkboxwill create a Multiple Choice (Multiple Answer) question. The user will be able to choose as many of the answer options as you add to the question. Requires answer options.dropboximagewill prompt the user to take a photo or choose one from their device's gallery.dropdownwill create a Multiple Choice (Single Answer) question formatted as a dropdown menu, similar to the "select" HTML element. When the user taps the question, they will be presented with the native picker UI of the OS. Requires answer option.gpswill prompt the user to confirm their current location, as determined by the device's onboard GPS.manualwill create a Short Answer question. The user can manually answer with the device's keyboard.manualnumericwill create a Short Answer question limited to numeric entry. The user can manually answer using the device's dial pad.optionwill create a Multiple Choice (Single Answer) question. The user will be prompted to choose one of several options. Requires answer options.webcollectwill display your Custom Question in a Web View below yourquestion_text. Requires answer option.
Response¶
If your question is successfully created, we will respond with raw XML containing a status of 1 and the numerical ID of your new question.
Example:
Deleting a Question¶
Required Variables¶
| Variable | Description |
|---|---|
| section | Must be set to questions. |
| action | Must be set to delete. |
| api_key | Must be set to your unique API key. |
| question_id | An integer or series of integers which specifies the question IDs that you wish to include in the list. You can specify a single integer or a comma-separated list of integers (Examples: 1005 or 1005, 1010, 1254). You can also use the keyword all to include all questions. |
Response¶
If you have successfully deleted your question, we will respond with raw XML containing a status of 1.
Example:
Adding an Answer Option¶
Required Variables¶
| Variable | Description |
|---|---|
| section | Must be set to questions. |
| action | Must be set to addanswer. |
| api_key | Must be set to your unique API key. |
| question_id | An integer which specifies the numeric question ID you want to add an answer to. You can specify a single integer or a comma-separated list of integers (Examples: 1005 or 1005, 1010, 1254). You can also use the keyword all to include all answers. |
| answer_text | A string which specifies the answer text you want to add to the question. |
Response¶
After we receive these variables, we will respond with raw XML containing an ID and status of 1.
Example:
Deleting an Answer Option¶
Required Variables¶
| Variable | Description |
|---|---|
| section | Must be set to questions. |
| action | Must be set to deleteanswer. |
| api_key | Must be set to your unique API key. |
| answer_id | An integer or series of integers specifying the numerical IDs of the answers you want to remove from a question. |
Response¶
After we receive these variables, we will respond with raw XML containing an ID and status of 1.
Example: