{
"option_id": "0"
}
{
"status": "success",
"data": {
"sponsored_poll_id": "123",
"question": "What kind of playlist are you making?",
"total_votes": 42,
"options": [
{ "id": "0", "text": "Wedding", "votes": 21, "percentage": 50 },
{ "id": "1", "text": "Study", "votes": 14, "percentage": 33.33 },
{ "id": "2", "text": "Workout", "votes": 7, "percentage": 16.67 }
]
}
}
API Reference
Poll Voting
Send a user’s poll answer and get back the results to show.
{
"option_id": "0"
}
{
"status": "success",
"data": {
"sponsored_poll_id": "123",
"question": "What kind of playlist are you making?",
"total_votes": 42,
"options": [
{ "id": "0", "text": "Wedding", "votes": 21, "percentage": 50 },
{ "id": "1", "text": "Study", "votes": 14, "percentage": 33.33 },
{ "id": "2", "text": "Workout", "votes": 7, "percentage": 16.67 }
]
}
}
A poll bid carries a signed
Show the results by reading
actions.vote_url. When the user picks an answer, POST it there. The response has the results to show in place of the answers.
Use vote_url exactly as returned. It already carries the token that ties the vote to this bid, so don’t rebuild or rewrite it.
Request
string
required
The
id of the answer the user picked, from the bid’s assets.options.{
"option_id": "0"
}
Response
{
"status": "success",
"data": {
"sponsored_poll_id": "123",
"question": "What kind of playlist are you making?",
"total_votes": 42,
"options": [
{ "id": "0", "text": "Wedding", "votes": 21, "percentage": 50 },
{ "id": "1", "text": "Study", "votes": 14, "percentage": 33.33 },
{ "id": "2", "text": "Workout", "votes": 7, "percentage": 16.67 }
]
}
}
object
data, not the top level of the response.
Voting twice
Avote_url counts one vote. Voting again with it is not an error: you get 200 and the same results, and the count doesn’t change. There’s nothing special to handle.
Status codes
| status | meaning | what to do |
|---|---|---|
200 | vote recorded, or already recorded | show data |
404 | the link expired, or option_id isn’t one of the poll’s answers | keep the chat going; don’t retry the same request |
422 | option_id is missing | fix the request |
503 | we couldn’t record it right now | keep the chat going |
After the vote
If the bid hasactions.click_url, show assets.cta linking to it. That’s the advertiser link: the vote itself never redirects. See Ad Formats & Rendering.