Polls
Get current poll
getPoll
Authentication needed Frontend needs to be restricted or open
Get the current poll contents if one is running
Response
{
infos: {
count: 5
from: 0
to: 5
},
poll: [
{
<See PLC item>
votes: 3 //number of votes
index: 0 //vote option index
},
...
],
timeleft: 51 // seconds left before poll ends
flag_uservoted: false // has user voted already?
}
Response
{
code: 425,
message: {
code: 'POLL_NOT_ACTIVE'
}
}
Vote in a poll
votePoll
Authentication needed Frontend needs to be restricted or open
Vote in a poll.
Request
{
index: 0 // vote option index, see getPoll
}
Response
{
code: 200,
message: {
code: 'POLL_VOTED',
data: <See poll object in getPoll>
}
}
Response
{
code: 500,
message: {
code: 'POLL_ERROR'
}
}
Response
{
code: 425,
message: {
code: 'POLL_NOT_ACTIVE'
}
}
Response
{
code: 429,
message: {
code: 'POLL_USER_ALREADY_VOTED'
}
}
Response
{
code: 404,
message: {
code: 'POLL_ERROR'
}
}
Response
{
code: 400,
message: {
// validation errors
}
}