Surveys
Introduction
Surveys are used to collect feedback, opinions, or information from Users and Departments.
The possible answer options for a survey are defined in the SurveyAnswerOptions, while the SurveyVotes represent the votes submitted by users.
Surveys can either be targeted to specific Users or Departments or to a targetable entity
Model Definition
Alias
survey
Relations
currentVote
Has one
survey_votes.survey_id, survey_votes.department_id, survey_votes.user_id
Computed Properties
hash- The hashedidof theSurvey.url- The URL to view theSurvey.
Traits
SoftDeletesHasTargetableHasFolder
Targetable Types
chatMessage- ASurveytargeted to aChatMessage.infoboardPost- ASurveytargeted to a InfoboardPost.manualEntry- ASurveytargeted to a ManualEntry.
Survey Types
singleChoice– Users can select only one SurveyAnswerOption.multipleChoice– Users can select multiple SurveyAnswerOptions.
Show Votes Types
The show_votes_type specifies when the user can view the results of the Survey.
none– Never.always– Always.after_vote– After submitting their vote.after_survey_end– After theSurveyhas ended.
Appends
The following appends can be applied to all Surveys:
answer_options_summary
answer_options_summaryAdds a node answer_options_summary to the response, which shows the total number of SurveyVotes for each SurveyAnswerOption of the Survey.
Example Response
List
Get a list of all Surveys for the authenticated user.
Definition
GET /api/surveys
Example Request
Example Response
Show
Show a single Survey by id.
Definition
GET /api/surveys/{id}
Example Request
Example Response
[Adm.] List
Get a list of all Surveys.
Definition
GET /api/administration/surveys
Example Request
Example Response
[Adm.] Show
Show a single Survey by id.
Definition
GET /api/administration/surveys/{id}
Example Request
Example Response
Create
Create a new Survey.
Definition
POST /api/administration/surveys
Request Keys
title *
string
-
The title of the Survey.
description
string
-
The description of the Survey.
folder_id
integer
-
The ID of the folder in which the Survey should be organized in the administration.
active
boolean
false
Controls the visibility of the survey for participants.
assign_mode
string
-
The assign mode of the Survey.
user_confirmation_required
boolean
false
The user must confirm if logged in with a group account. Voting with group accounts is then no longer possible.
start_date
datetime
-
The start date of the Survey.
end_date
datetime
-
The end day of the Survey.
Keys with * are required.
Example Request
Example Response
Update
Update an existing Survey by id.
If a survey contains SurveyVotes, editing is restricted to only those fields that are still allowed to be changed. Further editing is only possible after a reset of the Survey.
Definition
PUT /api/administration/surveys/{id}
Request Keys
title *
string
The title of the Survey.
description *
string
The description of the Survey.
folder_id
integer
The ID of the folder in which the Survey should be organized in the administration.
active
boolean
Controls the visibility of the survey for participants.
assign_mode
string
The assign mode of the Survey.
user_confirmation_required *
boolean
The user must confirm if logged in with a group account. Voting with group accounts is then no longer possible.
start_date *
datetime
The start date of the Survey.
end_date
datetime
The end day of the Survey.
Keys with * can no longer be edited after at least one vote has been submitted.
Example Request
Example Response
Reset
Reset an existing Survey by id.
When resetting, all SurveyVotes submitted for this Survey will be deleted.
Definition
PUT /api/administration/surveys/{id}
Example Request
Example Response
Delete
Delete an existing Survey by id.
Definition
DELETE /api/administration/surveys/{id}
Example Request
Example Response
Last updated