Post a Rich-Text Feed Element

Post a rich-text feed element in Chatter.

This example posts a feed element that includes two paragraphs, one in bold, and an extra line break between them.

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 three Message Segment Input: Text request bodies, four Message Segment Input: Markup Begin request bodies, and four Message Segment Input: Markup End request bodies.

Request body example
{
   "body":{
      "messageSegments":[
         {
            "markupType" : "Paragraph",
            "type" : "MarkupBegin"
         },
         {
            "markupType" : "Bold",
            "type" : "MarkupBegin"
         },
         {
             "text" : "First line of text.",
             "type" : "Text"
         },
         {
            "markupType" : "Bold",
            "type" : "MarkupEnd"
         },
         {
            "markupType" : "Paragraph",
            "type" : "MarkupEnd"
         },
         {
            "markupType" : "Paragraph",
            "type" : "MarkupBegin"
         },
         {
            "text" : " ",
            "type" : "Text"
         },
         {
            "markupType" : "Paragraph",
            "type" : "MarkupEnd"
         },
         {
            "markupType" : "Paragraph",
            "type" : "MarkupBegin"
         },
         {
            "text" : "Second line of text.",
            "type" : "Text"
         },
         {
            "markupType" : "Paragraph",
            "type" : "MarkupEnd"
         }
      ]
   },
   "subjectId":"me",
   "feedElementType":"FeedItem"
}
Returns
Feed Item