Newer Version Available

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

Post a Feed Element and Include a File from Salesforce

This example posts a feed element with a file that has been uploaded to Salesforce. To upload a new file, see Uploading Binary Files.

Resource
/chatter/feed-elements
HTTP method
POST
Request body
Feed Item Input
Request body example
1{
2   "body":{
3      "messageSegments":[
4         {
5            "type":"Text",
6            "text":"Please take a look at this file."
7         }
8      ]
9   },
10   "capabilities":{
11      "content":{
12         "contentDocumentId":"069D00000001pyS"
13      }
14   },
15   "subjectId":"me",
16   "feedElementType":"FeedItem"
17}
Returns
Feed Item