Surveys¶
A survey is a set of questions the customer answers after grading, or on its own in a survey-only campaign. The API lists the surveys of your account and returns the questions of each; the answers are delivered by the Generic Webhooks integration as survey events.
List surveys¶
GET /surveys/ returns the surveys of your account. Note the trailing slash.
GET https://app.instantfeedback.si/api/surveys/
Example response:
{
"count": 1,
"next": null,
"previous": null,
"results": [{
"id": 3,
"name": "Onboarding survey",
"is_active": true
}]
}
| Field | Meaning |
|---|---|
id |
Survey ID. |
name |
Survey name. |
is_active |
Whether the survey is active. Draft and inactive surveys return false. |
Get a survey¶
GET /surveys/:id returns one survey with its questions.
GET https://app.instantfeedback.si/api/surveys/3
Example response:
{
"id": 3,
"name": "Onboarding survey",
"is_active": true,
"questions": [{
"id": 11,
"question": "How likely are you to recommend us to a friend or colleague?",
"answer_type": "metric",
"instructions": "",
"required": true,
"is_active": true,
"config": {
"metric": "nps",
"start": 0,
"end": 10,
"step": 1,
"label_start": "Not at all likely",
"label_mid": "",
"label_end": "Very likely",
"nps_promoters": [9, 10],
"nps_detractors": [0, 1, 2, 3, 4, 5, 6]
}
}, {
"id": 12,
"question": "What helped you most during onboarding?",
"answer_type": "choice",
"instructions": "",
"required": true,
"is_active": true,
"config": {
"choices": ["Personal walkthrough", "Video guides", "Documentation", "Email support"],
"limit": "exact",
"limit_exact": 1,
"limit_min": 1,
"limit_max": 1,
"show_other": false
}
}, {
"id": 15,
"question": "What would you improve about onboarding?",
"answer_type": "text",
"instructions": "",
"required": false,
"is_active": true,
"config": {
"widget": "textarea",
"max_length": 500
}
}]
}
| Field | Meaning |
|---|---|
id |
Survey ID. |
name |
Survey name. |
is_active |
Whether the survey is active. |
questions |
The survey's questions, one object per question in the order the customer sees them; see the next table. |
Each entry of questions has these fields:
| Field | Meaning |
|---|---|
id |
Question ID. Survey events from the Generic Webhooks integration refer to it. |
question |
The question text. |
answer_type |
text, number, date, time, bool, choice, range, or metric. |
instructions |
Help text shown under the question, or an empty string. |
required |
Whether the customer must answer the question. |
is_active |
Whether the question is shown. |
config |
The question's settings, which depend on answer_type: for example choices and the answer limit for choice, start, end, and the labels for range and metric, min and max for number, date, and time, true_label and false_label for bool, and max_length for text. |
A survey that does not exist in your account returns HTTP 404.