Skip to content

Vote on poll

POST
/api/polls/{pollId}/vote
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)

pollId
required
string

Poll ID

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"
}

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
}