Polls

The Polls API provides a functionality for obtaining and managing polls.


Basic information

Base URI

Scopes

  • polls_read
  • polls_write

Endpoints

RESOURCE_URI — URI is obtained from token exchange point.

Prefix Endpoint Description
RESOURCE_URI polls/ Getting a list of polls
RESOURCE_URI polls/add/ Adding a poll
RESOURCE_URI polls/ID Retrieving poll details
RESOURCE_URI polls/ID/edit/ Editing a poll
RESOURCE_URI polls/ID/delete/ Deleting a poll
RESOURCE_URI polls/ID/vote/ Voting

+Getting a list of polls

Endpoint

Scopes

  • polls_read

Request

Response


+Retrieving poll details

Endpoint

Scopes

  • polls_read

Request

Response


+Adding a poll

Endpoint

Scopes

  • polls_write

Request

Response


+Editing a poll

Endpoint

Scopes

  • polls_write

Request

Response


+Deleting a poll

Endpoint

Scopes

  • polls_write

Request

  • No specific request params

Response

  • No specific responce params

+Voting

Endpoint

Scopes

  • No specific scopes

Request

Response


Definitions

PollsListRequest

Name Description

limit (o)
unsigned integer

Number of items expected in response.

cursor (o)
string

The value of the next_cursor / prev_cursor parameter from the responce.
Should be empty to get the first set (page) of elements.

fields (o)
object

@PollsItemFields
Read more about the Fields model.

PollsListResponse

Name Description

items[]
object

@EntriesItemResponse

limit
unsigned integer

Number of returned items (items per page).

next_cursor
string

URL for the next portion of items (next page).
Empty if there is no items for the next portion.

prev_cursor
string

URL for the previous portion of items (previous page).
Empty if there is no items for the previous portion.

total_count
unsigned integer

Total number of items.

PollsItemRequest

Name Description

fields (o)
object

@PollsItemFields
Read more about the Fields model.

PollsItemResponse

Name Description

uid
unsigned integer

ID of a user who added the attachment.

poll_id
unsigned integer

Poll ID.

poll_uid
unsigned integer

ID of a user who created the poll.

name
string

Name of the poll.

created_time ?
timestamp

Time when the poll was created.

finish_time ?
timestamp

Time when the poll was finished.

has_multi_choice ?
boolean

True, if the poll provides an opportunity for multiple answers.

has_own_choice ?
boolean

True, if the poll provides an opportunity for a personal answer.

can_vote ?
boolean

Flag that describes whether the current user can vote in the poll.

is_finished
boolean

Flag that describes whether the poll is finished.

votes_count
unsigned integer

Total number of votes.

privacy
string

Possible values:

  • by_choice
  • open
  • anonymous

button_text ?
string

Button's caption.

restrictions ?
object

@PollRestrictions

options[] ?
object

@PollOptions

PollRestrictions

Name Description

gender
string

Possible values:

  • male
  • female

age
object

Allowed age of voters.
@PollRestrictionsAge

location[]
unsigned integer

List of IDs of allowed locations.

PollOptions

Name Description

id
unsigned integer

Option ID. It is 999 for the own choice option.

name
string

Option title.

votes_count
unsigned integer

Number of votes for the option.

PollRestrictionsAge

  • from — e.g. 18 unsigned integer
  • till — e.g. 25 unsigned integer