function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
oleksandr vashchenkooleksandr vashchenko 

Chatter api example with rich-text

Hi, 

I am working with chatter api, and I have to create FeedItems, from API, that uses rich editor. 

http://docs.releasenotes.salesforce.com/en-us/winter16/release-notes/rn_chatter_api_resources.htm#ChatterRESTFeeds 

Make a rich-text feed post
Make a POST request to the existing /chatter/feed-elements resource with the new Message Segment Input: Markup Begin and Message Segment Input: Markup End request bodies to make a rich-text feed post.

Could somebody give me an example, of creating rich-text record?

Thank you,
Alex
oleksandr vashchenkooleksandr vashchenko
I found how to do it. Example: 


   "body" : {
      "messageSegments" : [
          {
           "markupType":"Paragraph",
           "type":"MarkupBegin"
          },
          {
            "type" : "Text",
            "text" : "When should we meet for release planning?"
          },
          {
          "markupType":"Paragraph",
          "type": "MarkupEnd"
          },
          {
           "markupType":"Bold",
           "type":"MarkupBegin"
          },
          {
            "type" : "Text",
            "text" : "Some cat"
          },
          {
          "markupType":"Bold",
          "type": "MarkupEnd"
          }
         ]
       },
   "feedElementType" : "FeedItem",
   "subjectId" : "005i0000004pQqb"
}

Maybe it will be helpfull for somebody.