Poll

Polls are currently only available on updates. The only operation we currently support is voting on a poll. A valid vote request has two fields in the POST body { "id" : 961, "select" : true }. The "id" is the poll option the signed in user would like to vote in, and "select" indicates whether to vote or un-vote on that choice. If the logged in user is trying to re-do an action already taken on a poll option, the Schoology app will return a 400 (i.e. a user is trying to vote on a poll option he or she has already voted on). To see possible polls in the api to vote on, make an updates call with the query parameter with_attachments=TRUE.

Operations

Vote

Vote on a poll option

Path POST https://api.schoology.com/v1/poll/{id}/vote
Content

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

JSON
{
    "id": "961",
    "select": "true"
}
XML
<body>
  <id>961</id>
  <select>true</select>
</body>
Return An entire update object with attachments included
JSON
{
    "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
            }
        ]
    }
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <id>5825455</id>
    <body>Best Gaming</body>
    <uid>45552</uid>
    <created>1389719819</created>
    <likes>0</likes>
    <user_like_action></user_like_action>
    <realm>school</realm>
    <school_id>344232</school_id>
    <num_comments>0</num_comments>
    <poll>
        <options>
            <id>1509</id>
            <title>Xbox One</title>
            <count>0</count>
            <selected></selected>
        </options>
        <options>
            <id>1511</id>
            <title>PS4</title>
            <count>1</count>
            <selected>1</selected>
        </options>
    </poll>
</result>