Surveys
These endpoints manage surveys from code. A survey is built, sent and read exactly like a quiz, so the requests and the objects are the same. Only the address, the key permissions and what a survey leaves out are different.
Before you start
Section titled “Before you start”- Every survey endpoint is under
/v1/surveysinstead of/v1/quizzes. A survey’s id under/v1/quizzesanswers404, and so does a quiz’s id under/v1/surveys. - A survey stays a survey. Creating one under
/v1/surveysmakes a survey (you can leavemodeout). Sending anothermodewhen you create or update it answers422. - A survey has no correct answers, points, grades or certificates. The grading, regrading, release and certificate endpoints exist for quizzes only, and so do a quiz’s summary, its exports and its item analysis: a survey has a summary of its own.
- An export saved straight to a drive (
.../drive) works as for quizzes: see Save an export to a drive. - A key needs the survey permissions:
get_surveysinstead ofget_quizzes, and so on. A key given only quiz permissions can’t read surveys. The access keys page lists them all. - Your plan counts surveys and survey responses separately from quizzes and quiz attempts.
Surveys and responses
Section titled “Surveys and responses”| Request | Key permission | Same as for quizzes |
|---|---|---|
GET /v1/surveys |
get_surveys |
List quizzes |
POST /v1/surveys |
create_survey |
Create a quiz |
GET /v1/surveys/{id} |
read_survey |
Get a quiz |
PUT /v1/surveys/{id} |
update_survey |
Update a quiz |
DELETE /v1/surveys/{id} |
delete_survey |
Delete a quiz |
POST /v1/surveys/{id}/duplicate |
duplicate_survey |
Duplicate a quiz |
GET /v1/surveys/{id}/export |
export_survey |
Export a quiz |
POST /v1/surveys/questions/import |
import_survey_questions |
Import questions from a file |
POST /v1/surveys/{id}/send-link |
send_survey_link |
Send a quiz’s link |
GET /v1/surveys/{id}/attempts |
get_survey_responses |
List attempts |
GET /v1/surveys/{id}/attempts/{attemptId} |
read_survey_response |
Get an attempt |
GET /v1/surveys/{id}/attempts/{attemptId}/answer-sheet |
read_survey_response_sheet |
Get an answer sheet |
POST /v1/surveys/{id}/answer-sheets, GET .../answer-sheets/{printId} |
read_survey_response_sheet |
Print answer sheets |
A response is listed and read as an attempt is, without score, maxScore, percent, passed and grade. Reading one response needs read_survey_response, not a grading permission. Its sheet is a response sheet, with the answers and no scores.
People and invitations
Section titled “People and invitations”| Request | Key permission | Same as for quizzes |
|---|---|---|
GET /v1/surveys/{id}/recipients |
get_survey_access_list |
List the recipients |
GET /v1/surveys/{id}/recipients/funnel |
get_survey_access_list |
The recipients’ funnel |
POST /v1/surveys/{id}/access-entries |
manage_survey_access_list |
Add people to the access list |
PUT, DELETE /v1/surveys/{id}/access-entries/{entryId} |
manage_survey_access_list |
Change a person on the access list |
POST /v1/surveys/{id}/access-entries/upload-preview, .../upload |
manage_survey_access_list |
Add people from a file |
POST, GET /v1/surveys/{id}/distributions |
send_survey_invitations, get_survey_distributions |
Send the invitations |
GET, DELETE /v1/surveys/{id}/distributions/{distributionId} |
get_survey_distributions, send_survey_invitations |
Get a wave |
POST /v1/surveys/{id}/recipients/remind, .../revoke, .../restore, .../export |
send_survey_invitations, manage_survey_access_list, get_survey_access_list |
Remind recipients |
GET /v1/surveys/{id}/access-sheet, POST .../access-sheet/refresh |
get_survey_access_list, manage_survey_access_list |
The access sheet’s status |
GET /v1/surveys/{id}/access-logs |
get_survey_access_logs |
List the access log |
A contact who declined surveys isn’t sent one, by a wave or a reminder.
Results
Section titled “Results”| Request | Key permission | Same as for quizzes |
|---|---|---|
GET /v1/surveys/{id}/results |
get_survey_results |
Get the results |
POST /v1/surveys/{id}/results/query |
get_survey_results |
Query the results |
POST /v1/surveys/{id}/results/crosstab |
get_survey_results |
Cross-tabulate the results |
GET /v1/surveys/{id}/results/export |
export_survey_results |
Export the responses |
POST /v1/surveys/{id}/results/exports, .../results/exports/drive, GET .../results/exports/{exportId} |
export_survey_results |
Export the responses in the background |
GET /v1/surveys/{id}/results/report.pdf |
export_survey_results |
Results report (PDF) |
GET, POST /v1/surveys/{id}/reports, PUT, DELETE .../reports/{reportId} |
get_survey_reports, manage_survey_reports |
Saved reports |
PUT, DELETE /v1/surveys/{id}/reports/{reportId}/share |
manage_survey_reports |
Share a saved report |
GET /v1/surveys/{id}/results/answers, .../results/groups |
get_survey_results |
List a text question’s answers |
GET /v1/surveys/{id}/analyses, .../analyses/answers |
get_survey_results |
The AI analysis: themes, quotes, summary |
PUT /v1/surveys/{id}/analyses/themes, .../analyses/settings |
manage_survey_analyses |
Change the themes; the personal-data switch |
GET /v1/surveys/{id}/summary |
get_survey_results |
Survey summary, below |
Survey summary
Section titled “Survey summary”GET /v1/surveys/{id}/summary gives the rows of the Summary tab: one per response the Results’ filter leaves (JSON, as GET .../results takes it), the newest first, page from 1 and perPage from 1 to 100 (25 by default; 422 otherwise). Headings and words are in the language of the request.
| Field | Type | Meaning |
|---|---|---|
columns |
array | Each column’s key (number, name, email, group, status, started, finished, finished_on, time, language, device, or question: and the question’s id), label, kind (text, number, moment, day or duration) and question (the question’s id, or null). |
items |
array | Each row’s responseId and cells: every column’s value by its key. A moment is ISO 8601 in the organization’s time zone, a day is YYYY-MM-DD, a duration is in seconds; an answer is in words (a grid as “Row: column; …”, a ranking as “1. first; 2. second”) or a number for a number, scale or rating question. |
total, page, perPage |
integer | The rows the filter leaves, and the page given. |
anonymous |
boolean | An anonymous survey: no name, email, group, started, finished or time columns, finished_on instead, and the rows in an order unrelated to when they were sent, the same on every page. |
withheld |
boolean | An anonymous survey whose filter leaves fewer than 5 finished responses: items is empty and total is 0. |
A quiz has no such address: its summary is GET /v1/quizzes/{id}/summary. The results sheet of the Summary tab is set up only in the app.
Quotas
Section titled “Quotas”A survey’s settings.quotas closes segments once they took as many responses as they allow (“200 from Kraków”): up to 20 quotas, each
| Field | Type | Meaning |
|---|---|---|
id |
string | Up to 64 letters, digits, - and _, each quota its own (422 at settings.quotas[n].id). Its count is kept under it: changing the id starts the count again. |
label |
string | Up to 100 characters, what the results call it. |
limit |
integer | From 1 to 1,000,000 responses. |
filter |
object | Which responses it takes, as the results’ filter ({"conditions": [...]}); no condition takes every response. |
closedText |
string or null | Up to 2,000 characters, what a respondent of a full quota reads; null for the standard words. |
A response is counted when it’s sent, in every quota whose condition it meets. When one of them is full, it is counted in none: it is stored with endedBy quota_full, its respondent reads that the survey is closed for them (quotaClosedText on the response), it is left out of the results, and no success message or redirect follows. Two responses sent at once for the last place never both take it. A quiz keeps no quotas.
GET/v1/surveys/{id}/results/quotas
Key permission: get_survey_results (Read survey results)
Response: 200, {"items": [{"id": "krakow", "label": "Kraków", "limit": 200, "filled": 200, "full": true}]}, in the survey’s order.
Question library
Section titled “Question library”| Request | Key permission | Same as for quizzes |
|---|---|---|
GET /v1/surveys/question-bank |
get_survey_question_bank |
List the question library |
POST /v1/surveys/question-bank |
manage_survey_question_bank |
Save questions to the library |
PUT /v1/surveys/question-bank/{id} |
manage_survey_question_bank |
Change a library question |
DELETE /v1/surveys/question-bank/{id} |
manage_survey_question_bank |
Remove a library question |
POST /v1/surveys/question-bank/copies |
get_survey_question_bank |
Copy library questions for a quiz |
POST /v1/surveys/question-bank/import |
manage_survey_question_bank |
Import questions into the library |
POST /v1/surveys/question-bank/export |
get_survey_question_bank |
Export library questions |
GET /v1/surveys/question-bank/template |
get_survey_question_bank |
Download the sheet template |
POST /v1/surveys/question-bank/delete |
manage_survey_question_bank |
Delete several library questions |
POST /v1/surveys/question-bank/tags |
manage_survey_question_bank |
Change the tags of library questions |
The surveys’ question library is a library of its own: it never holds a quiz’s questions. A question with an answerKey answers 422 at items[n].answerKey, and a section’s drawFrom draws from this library. Its questions carry no right answers or points, so a sheet for an import needs only question, type, options, tags, difficulty and id. An export takes only sheet: gift and moodle_xml answer 422.
A person’s survey data
Section titled “A person’s survey data”| Request | Key permission | Same as for quizzes |
|---|---|---|
GET /v1/surveys/people/export |
manage_survey_person_data |
Export a person’s quiz data |
POST /v1/surveys/people/erase |
manage_survey_person_data |
Erase a person’s quiz data |
These cover the person’s surveys only. Their quiz data is exported and erased under /v1/quizzes/people.