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
MatrixinlineMatrixinline 

Posting to group using chatter rest API fails..

Hi All. 

I am trying to post a chatter feed using 

METHOD: POST
URL: https://ap1.salesforce.com/services/data/v29.0/chatter/feeds/record/XXXXXXX/feed-items 
HEADER:  Authorization  OAuth   XXXXXXXXXXXXXXXXX


POST DATA:
{ "body" :
   {
      "messageSegments" : [
         {
           "type": "Text",
           "text" : "Check out the latest building proposal"
         }
      ]
    }
}




but it returned  

[{"message":"No attachment found and body is empty. Provide a non-empty 'text' parameter, or a rich input including non-empty message segments. If providing rich JSON/XML input in REST, make sure to include Content-Type header. In multipart REST, include the Content-Type in the part.","errorCode":"MISSING_ARGUMENT"}]

but when I changed the URL to 


https://ap1.salesforce.com/services/data/v29.0/chatter/feeds/record/XXXXXXX/feed-items?text=SomeTest

then it gets posted but text posted is queryparameter not from post data. 

MatrixinlineMatrixinline
Ok figured it out need to set content-type as "application/json"..