Newer Version Available
Post a Comment with an Inline Image
This example posts a comment with an inline image that has 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
This Comment 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 two Message Segment Input: Text request bodies and two Message Segment Input: Inline Image request bodies.
- Request body example
-
1{ 2 "body":{ 3 "messageSegments":[ 4 { 5 "type":"Text", 6 "text":"Please take a look at this file." 7 }, 8 { 9 "type":"InlineImage", 10 "fileId":"069xx00000000QO", 11 "altText":"API Spec" 12 }, 13 { 14 "type":"Text", 15 "text":"And this one." 16 }, 17 { 18 "type":"InlineImage", 19 "fileId":"069xx00000000QT", 20 "altText":"REST API Spec" 21 } 22 ] 23 } 24} - Returns
- Comment