3

I know this question has been asked earlier but I could not find the answer.

I am trying to create chatter Feed using Chatter connect API and my need is "Createdby user should be different than logged in User".

Please let me know if it is possible and if so then how.

Thanks

1 Answer 1

3

Impersonation is currently not supported in the Chatter Connect API (both the Chatter REST API and Chatter in Apex). If you need the CreatedBy user to be different than the logged in user, you need to use the SObject API to insert the FeedItem.

Unfortunately, one of the drawbacks of having to use the SObject API for inserting FeedItems is that you don't have the ability to include @-mentions in your posts.

3
  • Thanks Alouie for the reply: Could you please help me in finding the solution for below Scenario:" I have a System, in which chatter feed is getting inserted in two ways. First , through Custom Connect API and Second , through standard Chatter Functionality". Is there any way to distinguish between these two types of chatter feed? Jul 14, 2014 at 18:23
  • 1
    Spot on answer. I've asked about this and the only way to impersonate is via the SObject API as stated, but you do lose a lot of benefits!
    – Matt Lacey
    Jul 15, 2014 at 3:06
  • Arjun, you may want to create a separate question for that, since it's a different topic altogether. I don't think there's a general way to determine how a feed item was posted. However, if you're making a Chatter REST API call using a Connected App, you can inspect the "clientInfo" property of the feed item to retrieve the name of the Connected App that posted it.
    – alouie
    Jul 15, 2014 at 4:54

You must log in to answer this question.

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