List questions
Returns every question in a survey, in survey order, with the option values its answers can contain.
HTTP request
GET https://www.asqiro.com/api/v1/surveys/{id}/questions
Any API key in the survey's workspace.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| id | string | The survey id, as returned by the surveys endpoints.Required |
Response body
The response is a data array holding the complete question list. It carries no cursor: the questions of a survey are returned in one call.
| Field | Type | Description |
|---|---|---|
| id | string | Unique question id. This is the id that an answer refers to. |
| type | "textarea" | "email" | "checkbox" | "number" | "calendar" | "country" | "heatmap" | "scale" | "sort" | The question type, which decides how its answer value is encoded. |
| label | string | The question as shown to respondents, as plain text. |
| required | boolean | Whether a respondent has to answer before continuing. |
| allowMultiple | boolean | Whether the respondent may select more than one option. |
| order | integer | Position in the survey, ascending. |
| options[].value | string | What an answer contains when this option is chosen. |
| options[].label | string | The option as shown to respondents. Identical to value for text options. |
Note An answer identifies its question by id alone. Join answers[].fieldId to a question id here to recover the wording, and cache the result: this list changes when the survey is edited, not when a response arrives.
Note options is empty for question types that have none. For text options the value and the label are the same string; for image, audio, and video options an answer stores the option value, so match on that rather than on the label. Sections are layout, not questions, and are never returned.
Errors
- unauthorized · 401 · The API key is missing, malformed, deleted, or its creator lost workspace access. Check the Authorization header, then the key itself.
- forbidden · 403 · The key is valid but lacks the access this call needs - most often a read-only key attempting a write.
- not_found · 404 · No survey with that id is reachable by this key. A survey in another workspace answers the same way as one that does not exist.
- plan_upgrade_required · 403 · The workspace owner's plan does not include API access. Upgrading the plan restores it; retrying will not.
- rate_limited · 429 · Too many requests. The Retry-After response header carries the number of seconds to wait.
Example request
bash
curl "https://www.asqiro.com/api/v1/surveys/s_7t2qk8wvbf31/questions" \
-H "Authorization: Bearer $ASQIRO_API_KEY"Returns 200 on success.
json
{
"data": [
{
"id": "f_channels",
"type": "checkbox",
"label": "Which channels do you use?",
"required": true,
"allowMultiple": true,
"order": 1,
"options": [
{ "value": "Email", "label": "Email" },
{ "value": "Slack", "label": "Slack" }
]
},
{
"id": "f_reason",
"type": "textarea",
"label": "Why?",
"required": false,
"allowMultiple": false,
"order": 2,
"options": []
}
]
}