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
Sunil PalSunil Pal 

ConnectAPI.

Hello Eveyone,

I have to get the all the messages with the same converarstionhappening in chatter messgaes by using the ConnectAPI. Whenver we click on the messges under the recent message came it expands and display all the messges within that chain.  

Please provide me the method that is used for getting the messges realeted to that chain.
User-added imageUser-added image

When we click on the box written as 7:22 AM in screen 1, it expand and become screen 2. How to get the all the messages by using connectApi
Thanks,
Sunil
alouie_sfdcalouie_sfdc
Assuming that you want to use the ConnectApi namespace in Apex, the methods to use are in the ConnectApi.ChatterMessages class (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_ConnectAPI_ChatterMessages_static_methods.htm#apex_ConnectAPI_ChatterMessages_static_methods).

To get the data for a specific conversation (screen 2), the method to use is ConnectApi.ChatterMessages.getConversation() (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_ConnectAPI_ChatterMessages_static_methods.htm#apex_ConnectAPI_ChatterMessages_getConversation).

To get the list of conversations (screen 1), the method to use is ConnectApi.ChatterMessages.getConversations() (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_ConnectAPI_ChatterMessages_static_methods.htm#apex_ConnectAPI_ChatterMessages_getConversations).