Use Connect in Apex to get, send, search, and reply to messages. You can also get and search conversations, mark conversations as read, and get a count of unread messages.
The following are methods for ChatterMessages. All methods are static.
29.0
Yes
public static ConnectApi.ChatterConversation getConversation(String conversationId)
29.0
Yes
public static ConnectApi.ChatterConversation getConversation(String conversationId, String pageParam, Integer pageSize)
30.0
Yes
public static ConnectApi.ChatterConversation getConversation(String communityId, String conversationId)
30.0
Yes
public static ConnectApi.ChatterConversation getConversation(String communityId, String conversationId, String pageParam, String pageSize)
29.0
Yes
public static ConnectApi.ChatterConversationPage getConversations()
29.0
Yes
public static ConnectApi.ChatterConversationPage getConversations(String pageParam, Integer pageSize)
30.0
Yes
public static ConnectApi.ChatterConversationPage getConversations(String communityId)
30.0
Yes
public static ConnectApi.ChatterConversationPage getConversations(String communityId, String pageParam, Integer pageSize)
29.0
Yes
public static ConnectApi.ChatterMessage getMessage(String messageId)
30.0
Yes
public static ConnectApi.ChatterMessage getMessage(String communityId, String messageId)
29.0
Yes
public static ConnectApi.ChatterMessagePage getMessages()
29.0
Yes
public static ConnectApi.ChatterMessagePage getMessages(String pageParam, Integer pageSize)
30.0
Yes
public static ConnectApi.ChatterMessagePage getMessages(String communityId)
30.0
Yes
public static ConnectApi.ChatterMessagePage getMessages(String communityId, String pageParam, Integer pageSize)
29.0
Yes
public static ConnectApi.UnreadConversationCount getUnreadCount()
Type: ConnectApi.UnreadConversationCount
If there are fewer than 50 unread conversations, ConnectApi.UreadConversationCount returns the exact number of unread conversations and the hasMore property is false. If there are more than 50 unread conversations, ConnectApi.UreadConversationCount returns 50 unread conversations and the hasMore property is true.
30.0
Yes
public static ConnectApi.UnreadConversationCount getUnreadCount(String communityId)
Type: ConnectApi.UnreadConversationCount
If there are fewer than 50 unread conversations, ConnectApi.UreadConversationCount returns the exact number of unread conversations and the hasMore property is false. If there are more than 50 unread conversations, ConnectApi.UreadConversationCount returns 50 unread conversations and the hasMore property is true.
29.0
Yes
public static ConnectApi.ChatterConversationSummary markConversationRead(String conversationId, Boolean read)
30.0
Yes
public static ConnectApi.ChatterConversationSummary markConversationRead(String communityId, String conversationID, Boolean read)
29.0
Yes
public static ConnectApi.ChatterMessage replyToMessage(String text, String inReplyTo)
30.0
Yes
public static ConnectApi.ChatterMessage replyToMessage(String communityId, String text, String inReplyTo)
29.0
Yes
public static ConnectApi.ChatterConversation searchConversation(String conversationId, String q)
29.0
Yes
public static ConnectApi.ChatterConversation searchConversation(String conversationId, String pageParam, Integer pageSize, String q)
30.0
Yes
public static ConnectApi.ChatterConversation searchConversation(String communityId, String conversationId, String q)
30.0
Yes
public static ConnectApi.ChatterConversation searchConversation(String communityId, String conversationId, String pageParam, Integer pageSize, String q)
29.0
Yes
public static ConnectApi.ChatterConversationPage searchConversations(String q)
29.0
Yes
public static ConnectApi.ChatterConversationPage searchConversations(String pageParam, Integer pageSize, String q)
30.0
Yes
public static ConnectApi.ChatterConversationPage searchConversations(String communityId, String q)
30.0
Yes
public static ConnectApi.ChatterConversationPage searchConversations(String communityId, String pageParam, Integer pageSize, String q)
29.0
Yes
public static ConnectApi.ChatterMessagePage searchMessages(String q)
29.0
Yes
public static ConnectApi.ChatterMessagePage searchMessages(String pageParam, Integer pageSize, String q)
30.0
Yes
public static ConnectApi.ChatterMessagePage searchMessages(String communityId, String q)
30.0
Yes
public static ConnectApi.ChatterMessagePage searchMessages(String communityId, String pageParam, Integer pageSize, String q)
29.0
Yes
public static ConnectApi.ChatterMessage sendMessage(String text, String recipients)