Newer Version Available

This content describes an older version of this product. View Latest

Post a Poll

Post a poll feed element in Chatter.

This example posts a poll feed element with two choices.

Resource
/chatter/feed-elements
HTTP method
POST
Request body
Feed Item Input

This Feed Item Input request body includes a body property that is a Message Body Input request body. In this example, the Message Body Input request body includes a messageSegments property that includes the text of the poll.

This Feed Item Input request body also includes a capabilities property that is a Feed Element Capabilities Input request body. In this example, the Feed Element Capabilities Input includes a poll property that is a Poll Capability Input request body. The Poll Capability Input request body includes a choices property that indicates the poll choices.

Request body example
1{
2   "body":{
3      "messageSegments":[
4         {
5            "type":"Text",
6            "text":"When should we meet for release planning?"
7         }
8      ]
9   },
10   "capabilities":{
11      "poll":{
12         "choices":[
13            "Monday",
14            "Tuesday"
15         ]
16      }
17   },
18   "feedElementType":"FeedItem",
19   "subjectId":"me"
20}
Returns
Feed Item