Vote on poll
POST
/api/polls/{pollId}/vote
const url = 'http://localhost:3001/api/polls/example/vote';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"option_ids":["example"],"poll_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3001/api/polls/example/vote \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "option_ids": [ "example" ], "poll_id": "example" }'Submit a vote for one or more poll options (depending on poll settings)
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”pollId
required
string
Poll ID
Request Bodyrequired
Section titled “Request Bodyrequired”Vote request
Media typeapplication/json
object
option_ids
Option IDs to vote for (array for multiple choice)
Array<string>
poll_id
Poll ID
string
Examplegenerated
{ "option_ids": [ "example" ], "poll_id": "example"}Responses
Section titled “Responses”OK
Media typeapplication/json
object
message
string
success
boolean
Examplegenerated
{ "message": "example", "success": true}Bad Request
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}Unauthorized
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}