SurveyVotes

Introduction

SurveyVotes represent the votes cast by Users for a specific Survey.

Each SurveyVote is associated with a User, the Department and one or more SurveyVoteSelectedAnswerOptions. Survey are subject to Survey-specific rules such as "one vote per department" or user confirmation requirements.

Model Definition

Alias

surveyVote

Relations

Key
Relation
Type
Relation Field(s)

user

Belongs to

user_id

groupAccountUser

Belongs to

group_account_user_id

department

Belongs to

department_id

survey

Belongs to

survey_id

selectedAnswerOptions

Has many

survey_vote_selected_answer_options.survey_vote_id

List by Survey

Get a list of all SurveyVotes for a given Survey and authenticated user.

Definition

GET /api/surveys/{survey}/votes

Example Request

Example Response

Show

Show a single SurveyVote by id.

Definition

GET /api/surveys/{survey}/votes/{id}

Example Request

Example Response

Show Current

Show the current SurveyVote for a given survey and authenticated user.

Definition

GET /api/surveys/{survey}/votes/current

Example Request

Example Response

[Adm.] List

Get a list of all SurveyVotes for a given survey (administration).

Definition

GET /api/administration/surveys/{survey}/votes

Example Request

Example Response

[Adm.] Show

Show a single SurveyVote by id (administration).

Definition

GET /api/administration/surveys/{survey}/votes/{id}

Example Request

Example Response

Create

Create a new SurveyVote for a survey.

Definition

POST /api/surveys/{survey}/votes

Request Keys

Key
Type
Default
Description

survey_answer_option_ids *

array

-

Array of SurveyAnswerOption IDs selected.

Keys with * are required.

Example Request

Example Response

Delete

Delete an existing SurveyVote by id.

Definition

DELETE /api/surveys/{survey}/votes/{id}

Example Request

Example Response

Last updated