Newer Version Available

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

Post a Comment and Include a File from Salesforce

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

Resource
/chatter/feed-elements/feedElementId/capabilities/comments/items
HTTP method
POST
Request body
Comment Input
Request parameter
text
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}
Returns
Comment