+ Start a Discussion
sumithasumitha 

How to post in chatter from workbench or any application

Hi Guys, 
Need help on creating a post in chatter from workbench or any application like postman tools. 
when we try using workbench it showing as "INVALID SESSION id".

please advice on possible solution. 
Thanks in advance, 
Sumitha P
Best Answer chosen by sumitha
David Zhu 🔥David Zhu 🔥
You can do this:
Method: Post
URL: /services/data/v48.0/chatter/feed-elements
Put the body in the format:
replace subjectId to the parent Id of the chatter post.  or "me" if chatter post to your own user profile.
{
   "body":{
      "messageSegments":[
         {
            "type":"Text",
            "text":"xxxxWhen should we meet for release planning?"
         }
      ]
   },

   "feedElementType":"FeedItem",
   "subjectId":"0032C00000OO6vpQAD"
}


 

All Answers

VinayVinay (Salesforce Developers) 
Hi Sumitha,

Check below link which can help you.

https://salesforce.stackexchange.com/questions/181581/create-chatter-post-with-url-link-for-chatter-api-version-39-0

Thanks,
Vinay Kumar
David Zhu 🔥David Zhu 🔥
You can do this:
Method: Post
URL: /services/data/v48.0/chatter/feed-elements
Put the body in the format:
replace subjectId to the parent Id of the chatter post.  or "me" if chatter post to your own user profile.
{
   "body":{
      "messageSegments":[
         {
            "type":"Text",
            "text":"xxxxWhen should we meet for release planning?"
         }
      ]
   },

   "feedElementType":"FeedItem",
   "subjectId":"0032C00000OO6vpQAD"
}


 
This was selected as the best answer
sumithasumitha
Hi Guys,

Thanks for your reply, it is working on my end.

Thanks,
Sumitha P