Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (59 sloc) 1.92 KB

Poll

+io.pnut.core.poll

This dynamically inserts information about a Pnut.io Poll into raw. The poll information is merged with any other values to form a single object. Easily attach a poll to a post or message, using a "replacement value". By including the following example as a raw item, the API will replace the values given with relevant details from a poll stored in the API.

Example

Provided to Pnut.io

{
    "type": "com.example.test",
    "value": {
        "+io.pnut.core.poll": {
            "poll_token": "12345abcde",
            "poll_id": "1",
        },
        "other_values": "are preserved"
    }
}

Returned by API

{
    "type": "com.example.test",
    "value": {
        "poll_token": "12345abcde",
        "poll_id": "1",
        "prompt": "This is a poll?",
        "closed_at": "2018-03-24T01:00:00Z",
        "options": [
            {
                "text": "Looks like it",
                "position": "1"
            },
            {
                "text": "Fake news",
                "position": "2"
            }
        ].
        "other_values": "are preserved"
    }
}

Fields

Field Required? Type Description
poll_token Required string A valid poll token that Pnut.io returned when you created a poll.
poll_id Required string The id of the poll.

Maintainers

Used by

Related raws