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
AladinCGAladinCG 

Access Chat messages in apex class




I want to access my Chat messages from my Apex Class. So, I need to access the object of chat message  so If anybody knows how to access the chat message. Please suggest me the solution

Thanks
Nirav
Ashish_SFDCAshish_SFDC
Hi ,


Permission required: System Permissions > Manage Chatter Messages
You'll have to clone one of the existing profiles to enable it, and then assign a user to the profile. If you're cloning the Admin profile, keep in mind you'll need an other admin to change your profile to the new profile with manage chatter messages enabled.


In dataloader:
Log in with a using having the above permission/profile.
you can export, chek "Show all Salesforce objects" and select the Chatter Message object.
In step 3: Edit your query you can enter a query, for instance : "SELECT id, body, ConversationId, SenderId, SentDate from chattermessage"

This will give you an export of all chatter messages. Im at this time not sure how you can see to whom the message is send, I suppose that's in the conversation object.
You could also add a '"where Senderid != 'Chatter Expert user Id' " to your query to filter out all the  default welcome to chatter messages and such.


Regards,
Ashish
KSusan CoxKSusan Cox
Hi Ashish,

             I want to know where the chatter messages are getting store because I want to use this in my class.

Thanks

         
Ashish_SFDCAshish_SFDC
Hi , 


You need to enable the Manage Chatter Messages system permission on a cloned System Administrator profile before you have access to these sObjects.

The ChatterMessage and ChatterConversation objects is what you are looking for.

for instance:

SELECT Body,ConversationId,Id,SenderId,SentDate FROM ChatterMessage


http://salesforce.stackexchange.com/questions/1041/what-is-the-sobject-for-a-private-message


Regards,
Ashish
KSusan CoxKSusan Cox
Hi,
I want to know that what is the SObject for a Chat Conversation?

Thanks
Ashish_SFDCAshish_SFDC
Hi Susan, 


ChatterMessage and ChatterConversation are teh SObjects. 


Regards,
Ashish
alouie_sfdcalouie_sfdc
If you're talking about the real-time chat feature, it is not supported in the API. ChatterMessage and ChatterConversation are for the Private Messages feature, not the real-time chat feature.