Skip to content

Poll

Polls are currently only available on updates. The only operation supported is voting on a poll. A valid vote request has two fields in the POST body: {"id": 961, "select": true} where id is the poll option the signed-in user would like to vote in and select indicates whether to vote or un-vote that choice. If the logged-in user tries to repeat an action already taken on a poll option, the Schoology API returns a 400. To see possible polls to vote on, make an updates call with the query parameter with_attachments=TRUE.

Field Name Description Type
id* ID The Schoology ID of the update containing the poll. integer
body Body The text body of the update. string
uid User ID ID of the user who created the update. integer
created Created Unix timestamp when the update was created. integer
likes Likes Number of likes on the update. integer
user_like_action User Like Action Whether the current user has liked the update. boolean
realm Realm The realm of the update (for example school). string
school_id School ID ID of the school associated with the update. integer
num_comments Number of Comments Number of comments on the update. integer
poll* Poll Object containing poll details and options. object
poll.options[] .id* Option ID ID of the poll option. integer
poll.options[] .title* Option Title Title/label of the poll option. string
poll.options[] .count Option Count Number of votes for the option. integer
poll.options[] .selected Option Selected Whether the current user has selected this option. boolean

* = Required

Vote on a poll option

Content An object indicating what sort of action the user would like to take on the poll

{
"id": "961",
"select": "true"
}

Return An entire update object with attachments included

{
"id": 5825455,
"body": "Best Gaming",
"uid": 45552,
"created": 1389719819,
"likes": 0,
"user_like_action": false,
"realm": "school",
"school_id": 344232,
"num_comments": 0,
"poll": {
"options": [
{
"id": 1509,
"title": "Xbox One",
"count": 0,
"selected": false
},
{
"id": 1511,
"title": "PS4",
"count": 1,
"selected": true
}
]
}
}