PollChoices
Manage choices for polls
A PollChoice object looks like:
Polling::PollChoicesController#index
GET /api/v1/polls/:poll_id/poll_choices
GET /api/v1/polls/:poll_id/poll_choices
Scope: url:GET|/api/v1/polls/:poll_id/poll_choices
Returns the paginated list of PollChoices in this poll.
Example Response:
Polling::PollChoicesController#show
GET /api/v1/polls/:poll_id/poll_choices/:id
GET /api/v1/polls/:poll_id/poll_choices/:id
Scope: url:GET|/api/v1/polls/:poll_id/poll_choices/:id
Returns the poll choice with the given id
Example Response:
Polling::PollChoicesController#create
POST /api/v1/polls/:poll_id/poll_choices
POST /api/v1/polls/:poll_id/poll_choices
Scope: url:POST|/api/v1/polls/:poll_id/poll_choices
Create a new poll choice for this poll
Request Parameters:
poll_choices[][text]
Required string
The descriptive text of the poll choice.
poll_choices[][is_correct]
boolean
Whether this poll choice is considered correct or not. Defaults to false.
poll_choices[][position]
integer
The order this poll choice should be returned in the context it’s sibling poll choices.
Example Response:
Polling::PollChoicesController#update
PUT /api/v1/polls/:poll_id/poll_choices/:id
PUT /api/v1/polls/:poll_id/poll_choices/:id
Scope: url:PUT|/api/v1/polls/:poll_id/poll_choices/:id
Update an existing poll choice for this poll
Request Parameters:
poll_choices[][text]
Required string
The descriptive text of the poll choice.
poll_choices[][is_correct]
boolean
Whether this poll choice is considered correct or not. Defaults to false.
poll_choices[][position]
integer
The order this poll choice should be returned in the context it’s sibling poll choices.
Example Response:
Polling::PollChoicesController#destroy
DELETE /api/v1/polls/:poll_id/poll_choices/:id
DELETE /api/v1/polls/:poll_id/poll_choices/:id
Scope: url:DELETE|/api/v1/polls/:poll_id/poll_choices/:id
204 No Content response code is returned if the deletion was successful.
This documentation is generated directly from the Canvas LMS source code, available on Github.
Last updated
Was this helpful?