Update Poll
When creating a poll, provide the desired values.
This method requires authentication.
When creating a poll, provide the desired values. When updating an existing poll, only provide the values to overwrite. To delete a value, pass an empty string.
METADATA
* ownerid: (required) The userid of the owner of the poll
DISPLAY PROPERTIES
* title: (required) The title of the poll. Required on create. Optional on update.
* description: (optional) The description of the poll
* pictureurl: (optional) The URL for a picture for the room
* embedcontenttop: (optional) Content to be displayed at the top of the poll
* embedcontentbottom: (optional) Content to be displayed at the bottom of the poll
* displayresults: (optional) [default="aftervote"/always/pollclosed] Use "aftervote" to display results after a vote is over. Set to "always" to return current standings. Set to "pollclosed" to only allow poll results to be disclosed when the poll is closed.
* sortchoices: (optional, "random" or "asconfigured", default = "asconfigured") When retrieving the list of response choices they can be displayed in the order you specified or in random order.
BEHAVIOR SETTINGS
* allowmultiplechoicesperuser: ("true" or default = "false") If true, the user may submit answers for more than one choice.
* maxtotalresponsesperuser: (default = 1). This is the number of times that a user can respond to the poll, the total of all responses regardless of which choice was selected.
* maxresponsesperchoiceperuser: (default = 1). The maximum time a user may submit a response per choice. For example you can make it so the user can respond 3 times but must select a different choice with each response, o ryou could allow the user to vote as many times as desired per choice with all their available responses.
AUTO PUBLISH SETTINGS
* whenpollpublish: (optional) [default=now] An ISO-8601 date time. Now by default. If specified, poll is hidden until the specified date and time.
* whenpollexpires: (optional) [default=null] An ISO-8601 date time. If specified, the poll transitions to the expired state at this time and is no longer returned by the API (It only exists as archived data).
* whenpollopens: (optional) [default=now] An ISO-8601 date time. Now by default. If specified, poll is not open until this time and no one can respond until then.
* whenpollcloses: (optional) [default=null] An ISO-8601 date time. Null by default. If specified, poll transitions to closed state at this time and doesn't accept responses.
CUSTOM FIELDS
* customid: (optional) A customid for the room. Can be unused, or a unique key. If provided, and a poll with that customid is already created this call will update the existing poll.
* customtype : (optional) Custom type string.
* custompayload : (optional) Custom payload string.
* customfield1 : (optional) User custom field 1. Store any string value you want here, limit 1024 bytes.
* customfield2 : (optional) User custom field 2. Store any string value you want here, limit 1024 bytes.
* customtags : (optional) A comma delimited list of tags
Parameters
Values in the path and query string.
appid path The TalkLabs application ID assigned to your account.
Example:your-app-id pollid path The TalkLabs assigned poll ID.
Example:poll-id JSON body
Send as application/json.
ownerUserId title subtitle description pictureUrl embedContentTop embedContentBottom videoId displayResults sortChoices maxTotalResponsesPerUser The maximum number of votes an individual can cast
allowMultipleChoicesPerUser Should users be allowed to vote for more than one response choice
maxResponsesPerChoicePerUser The maximum number of times a user can vote for a single choice
whenPollPublish whenPollOpens whenPollCloses whenPollExpires allowAnonymousPolling leadCaptureEnabled leadCaptureRequired leadCaptureName leadCaptureTitle leadCaptureDescription leadCapturePrompt socialShareEnable socialHandleFacebook socialHandleX socialHandleTikTok socialHandleWhatsApp socialCardTitle socialCardImageUrl socialCardUrl customType customId A customer defined ID chosen by your application. TalkLabs stores it so you can retrieve the resource without keeping its TalkLabs ID.
customPayload customField1 customField2 customTags {
"title": "What is your favorite color?",
"description": "Vote for your favorite color"
} 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 {
"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": ""
}
}