0

I need to retrieve the direct messages sent to a community user using Apex. I found that direct messages stores under "ChatterMessage" Object.

After enabling the system permissions "Manage Chatter Messages and Direct Messages", I am able to do the SOQL on the "ChatterMessage" SObject using Developer Console. But still, it's returning 0 records however I made a couple of direct message at my private community.

TIA.

1 Answer 1

0

ChatterMessage object is for private messages.

postFeedElement(communityId, feedElement) is for direct messages.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_examples_post_feed_element_direct_message.htm

You must log in to answer this question.

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