POST Polls
Create Poll Response (Cast a vote)
Use thsi method to respond to a poll or cast a vote.
This method requires authentication.
Use thsi method to respond to a poll or cast a vote.
* pollid: (required) The id of the poll
* userid: (required) The id of the user responding
* choiceid: (optional) The selected choice
| Response Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request, not formatted correctly. See response for details |
| 403 | Forbidden, token doesn't have permission to do this operation |
| 409 | Conflict, request is formatted OK but violates a rule |
Request
Parameters
Values in the path and query string.
appid path string TalkLabs ID required
The TalkLabs application ID assigned to your account.
Example:your-app-id pollid path string TalkLabs ID required
The TalkLabs assigned poll ID.
Example:poll-id Request
JSON body
Send as application/json.
pollID string TalkLabs ID required
The TalkLabs assigned poll ID.
choiceId string TalkLabs ID required
The TalkLabs assigned poll choice ID.
userId string customer-defined
The customer defined user ID from your application or identity system.
Request example
{
"choiceId": "<choiceId>",
"pollID": "poll-id"
} Response
Status codes
Every JSON response uses the API result envelope.
200 OK ApiResult 400 Bad Request ApiResult 403 Forbidden ApiResult 500 Internal Server Error ApiResult Example response · 200
{
"message": "Success",
"errors": {},
"data": {
"kind": "poll.poll",
"id": "662da20fe45ad80a7f2bd950",
"appid": "662bb49bf10e9a26a7e8ed92",
"ownerid": "u-8842",
"title": "Sample Poll 1: Vote for your favorite color",
"description": "Vote for your favorite color",
"posterurl": "",
"embedcontenttop": "",
"embedcontentbotton": "",
"whenpollpublish": "2024-04-28T01:10:39.5358368Z",
"whenpollopens": "2024-04-27T21:10:39.5358872-04:00",
"whenpollcloses": null,
"whenpollexpires": null,
"displayresults": 1,
"sortanswers": 0,
"customtype": "",
"customid": "sample-poll-1-vote",
"custompayload": "",
"customtags": [],
"customfield1": "",
"customfield2": ""
}
}