Newer Version Available

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

Post a Feed Item

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 has one Message Segment Input: Text request body and one Message Segment Input: Mention request body.

Request body example
In the subjectId, specify the user, group, or record that will parent the feed item.
1{ 
2   "body" : {
3      "messageSegments" : [
4         {
5            "type" : "Text",
6            "text" : "When should we meet for release planning? "
7         },
8         {   
9            "type" : "Mention",
10            "id" : "005D00000016Qxp"
11         }]
12       },
13   "feedElementType" : "FeedItem",
14   "subjectId" : "0F9B000000000W2"
15}
Request parameters
feedElementType, subjectId, text
Request parameter example
1/services/data/v40.0/chatter/feed-elements?feedElementType=FeedItem&subjectId=0F9B000000000W2&text=New+post
Returns
Feed Item