1

I have two SFDC orgs - org1 and org2. I want to send a POST request from org1 to org2. I've already created a connected app on org2 and have named credentials + auth provider set up on org1.

More specifically, I want to chatter post on org2 via the POST request. I followed the following documentation on chatter api : https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/quickreference_post_feed_item.htm

Then I logged into workbench and attempted to use the REST explorer. I selected POST, the path was /services/data/v47.0/chatter/feed-elements, and the payload was the following (similar to what's on documentation)

{ 
"body" : {
  "messageSegments" : [
     {
        "type" : "Text",
        "text" : "When should we meet for release planning? "
     }]
   },
  "feedElementType" : "FeedItem",
  "subjectId" : "0F91R000000kKT7SAM"
}

The error I keep getting is Service not found at: /services/data/v47.0/chatter/feed-elements. I'm not sure what I'm doing wrong because the chatter/feed-elements endpoint is from the documentation. Open to other routes for posting between 2 orgs

1 Answer 1

0

This error occurs when subjectId is an invalid ID. Make sure you're using the correct ID for whatever you're trying to post to on the far end. I tried copying your code verbatim, got the service-not-found error, then changed the subjectId to my 005... user Id, and it posted successfully. Workbench translates 404 to "service not found", but in actuality, it was the ID that was not found, thus returning a 404.

3
  • The Id value is set to the Id of the Group where I would like to post my message. The group Id is valid, still isn't working. And the Id is of the Group in Org2 too. Anything else I'm missing? May 21, 2020 at 0:01
  • @user2582622 I don't know what else to say. Permissions issue, maybe? All I know is it doesn't like the ID you're passing in. Try as a different user and see if you get different results.
    – sfdcfox
    May 21, 2020 at 1:17
  • Is there any specific permission that I would need to enable to send REST requests? My current user is a Sys Admin. Thoughts? May 21, 2020 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .