ChatterMessages Class
Get, send, search, and reply to private messages. You can also get and search private conversations, mark conversations as read, and get a count of unread private messages.
Private messages and direct messages are different features. Direct messages are newer and offer a richer feature set for private communication in Experience Cloud sites. Direct messages are a capability within Chatter feeds. To work with direct messages, use the ChatterFeeds Class.
These methods are for ChatterMessages. All methods are static.
All methods in this class require Chatter and are subject to the per user, per namespace, per hour rate limit.
-
getConversation(conversationId)
Get a conversation.
-
getConversation(conversationId, pageParam, pageSize)
Get a page of a conversation.
-
getConversation(communityId, conversationId)
Get a conversation from an Experience Cloud site.
-
getConversation(communityId, conversationId, pageParam, pageSize)
Get a page of a conversation from an Experience Cloud site.
-
Get the most recent conversations.
-
getConversations(pageParam, pageSize)
Get a page of conversations.
-
Get the most recent conversations from an Experience Cloud site.
-
getConversations(communityId, pageParam, pageSize)
Get a page of conversations from an Experience Cloud site.
-
Get a message.
-
getMessage(communityId, messageId)
Get a message from an Experience Cloud site.
-
Get the most recent messages.
-
getMessages(pageParam, pageSize)
Get a page of messages.
-
Get the most recent messages from an Experience Cloud site.
-
getMessages(communityId, pageParam, pageSize)
Get a page of messages from an Experience Cloud site.
-
Get the number of conversations that are marked unread.
-
Get the number of conversations that are marked unread in an Experience Cloud site.
-
markConversationRead(conversationId, read)
Mark a conversation as read or unread.
-
markConversationRead(communityId, conversationID, read)
Mark a conversation as read or unread in an Experience Cloud site.
-
replyToMessage(text, inReplyTo)
Reply to a message.
-
replyToMessage(communityId, text, inReplyTo)
Reply to a message in an Experience Cloud site.
-
searchConversation(conversationId, q)
Get a conversation that matches the search criteria.
-
searchConversation(conversationId, pageParam, pageSize, q)
Get a conversation with a page of messages that match the search criteria.
-
searchConversation(communityId, conversationId, q)
Get a conversation with messages that match the search criteria in an Experience Cloud site.
-
searchConversation(communityId, conversationId, pageParam, pageSize, q)
Get a conversation with a page of messages that match the search criteria in an Experience Cloud site.
-
Get conversations in which member names and messages match the search criteria.
-
searchConversations(pageParam, pageSize, q)
Get a page of conversations in which member names and messages match the search criteria.
-
searchConversations(communityId, q)
Get conversations in which member names and messages match the search criteria in an Experience Cloud site.
-
searchConversations(communityId, pageParam, pageSize, q)
Get a page of conversations in which member names and messages match the search criteria in an Experience Cloud site.
-
Get messages that match the search criteria.
-
searchMessages(pageParam, pageSize, q)
Get a page of messages that match the search criteria.
-
searchMessages(communityId, q)
Get messages that match the search criteria in an Experience Cloud site.
-
searchMessages(communityId, pageParam, pageSize, q)
Get a page of messages that match the search criteria in an Experience Cloud site.
-
Send a message to a list of recipients.
-
sendMessage(communityId, text, recipients)
Send a message to a list of recipients in an Experience Cloud site.
Get a conversation.
29.0
Yes
public static ConnectApi.ChatterConversation getConversation(String conversationId)
- conversationId
Type: String
ID for the conversation.
Type: ConnectApi.ChatterConversation
Get a page of a conversation.
29.0
Yes
public static ConnectApi.ChatterConversation getConversation(String conversationId, String pageParam, Integer pageSize)
- conversationId
Type: String
ID for the conversation.
- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.
Type: ConnectApi.ChatterConversation
Get a conversation from an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterConversation getConversation(String communityId, String conversationId)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- conversationId
Type: String
ID for the conversation.
Type: ConnectApi.ChatterConversation
Get a page of a conversation from an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterConversation getConversation(String communityId, String conversationId, String pageParam, String pageSize)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- conversationId
Type: String
ID for the conversation.
- pageParam
Type:String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.
Type: ConnectApi.ChatterConversation
Get the most recent conversations.
29.0
Yes
public static ConnectApi.ChatterConversationPage getConversations()
Type: ConnectApi.ChatterConversationPage
Get a page of conversations.
29.0
Yes
public static ConnectApi.ChatterConversationPage getConversations(String pageParam, Integer pageSize)
- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.
Type: ConnectApi.ChatterConversationPage
Get the most recent conversations from an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterConversationPage getConversations(String communityId)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.
Type: ConnectApi.ChatterConversationPage
Get a page of conversations from an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterConversationPage getConversations(String communityId, String pageParam, Integer pageSize)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- pageParam
Type:String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.
Type: ConnectApi.ChatterConversationPage
Get a message.
29.0
Yes
public static ConnectApi.ChatterMessage getMessage(String messageId)
- messageId
Type: String
ID for the message.
Type: ConnectApi.ChatterMessage
Get a message from an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterMessage getMessage(String communityId, String messageId)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- messageId
Type: String
ID for the message.
Type:ConnectApi.ChatterMessage
Get the most recent messages.
29.0
Yes
public static ConnectApi.ChatterMessagePage getMessages()
Type: ConnectApi.ChatterMessagePage
Get a page of messages.
29.0
Yes
public static ConnectApi.ChatterMessagePage getMessages(String pageParam, Integer pageSize)
- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.
Type: ConnectApi.ChatterMessagePage
Get the most recent messages from an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterMessagePage getMessages(String communityId)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.
Type: ConnectApi.ChatterMessagePage
Get a page of messages from an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterMessagePage getMessages(String communityId, String pageParam, Integer pageSize)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.
Type: ConnectApi.ChatterMessagePage
Get the number of conversations that are marked unread.
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.
Get the number of conversations that are marked unread in an Experience Cloud site.
30.0
Yes
public static ConnectApi.UnreadConversationCount getUnreadCount(String communityId)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.
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.
Mark a conversation as read or unread.
29.0
Yes
public static ConnectApi.ChatterConversationSummary markConversationRead(String conversationId, Boolean read)
- conversationId
Type: String
ID for the conversation.
- read
Type: Boolean
Specify whether the conversation is read (
true) or not (false).
Type: ConnectApi.ChatterConversationSummary
Mark a conversation as read or unread in an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterConversationSummary markConversationRead(String communityId, String conversationID, Boolean read)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- conversationId
Type: String
ID for the conversation.
- read
Type: Boolean
Specify whether the conversation is read (
true) or not (false).
Type: ConnectApi.ChatterConversationSummary
Reply to a message.
29.0
Yes
public static ConnectApi.ChatterMessage replyToMessage(String text, String inReplyTo)
- text
Type: String
Text of the message. Can’t be empty or over 10,000 characters.
- inReplyTo
Type: String
ID of the message that is being responded to.
Type: ConnectApi.ChatterMessage
Reply to a message in an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterMessage replyToMessage(String communityId, String text, String inReplyTo)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- text
Type: String
Text of the message. Can’t be empty or over 10,000 characters.
- inReplyTo
Type: String
ID of the message that is being responded to.
Type: ConnectApi.ChatterMessage
Get a conversation that matches the search criteria.
29.0
Yes
public static ConnectApi.ChatterConversation searchConversation(String conversationId, String q)
- conversationId
Type: String
ID for the conversation.
- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterConversation
Get a conversation with a page of messages that match the search criteria.
29.0
Yes
public static ConnectApi.ChatterConversation searchConversation(String conversationId, String pageParam, Integer pageSize, String q)
- conversationId
Type: String
ID for the conversation.
- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterConversation
Get a conversation with messages that match the search criteria in an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterConversation searchConversation(String communityId, String conversationId, String q)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- conversationId
Type: String
ID for the conversation.
- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterConversation
Get a conversation with a page of messages that match the search criteria in an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterConversation searchConversation(String communityId, String conversationId, String pageParam, Integer pageSize, String q)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- conversationId
Type: String
ID for the conversation.
- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterConversation
Get conversations in which member names and messages match the search criteria.
29.0
Yes
public static ConnectApi.ChatterConversationPage searchConversations(String q)
- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterConversationPage
Get a page of conversations in which member names and messages match the search criteria.
29.0
Yes
public static ConnectApi.ChatterConversationPage searchConversations(String pageParam, Integer pageSize, String q)
- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterConversationPage
Get conversations in which member names and messages match the search criteria in an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterConversationPage searchConversations(String communityId, String q)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterConversationPage
Get a page of conversations in which member names and messages match the search criteria in an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterConversationPage searchConversations(String communityId, String pageParam, Integer pageSize, String q)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterConversationPage
Get messages that match the search criteria.
29.0
Yes
public static ConnectApi.ChatterMessagePage searchMessages(String q)
- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterMessagePage
Get a page of messages that match the search criteria.
29.0
Yes
public static ConnectApi.ChatterMessagePage searchMessages(String pageParam, Integer pageSize, String q)
- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterMessagePage
Get messages that match the search criteria in an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterMessagePage searchMessages(String communityId, String q)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterMessagePage
Get a page of messages that match the search criteria in an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterMessagePage searchMessages(String communityId, String pageParam, Integer pageSize, String q)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- q
Type: String
Required and can’t be
null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
Type: ConnectApi.ChatterMessagePage
Send a message to a list of recipients.
29.0
Yes
public static ConnectApi.ChatterMessage sendMessage(String text, String recipients)
- text
Type: String
Text of the message. Can’t be empty or over 10,000 characters.
- recipients
Type: String
Up to nine comma-separated IDs of the users receiving the message.
Type: ConnectApi.ChatterMessage
Send a message to a list of recipients in an Experience Cloud site.
30.0
Yes
public static ConnectApi.ChatterMessage sendMessage(String communityId, String text, String recipients)
- communityId
Type:String
ID for an Experience Cloud site,
internal, ornull.- text
Type: String
Text of the message. Can’t be empty or over 10,000 characters.
- recipients
Type: String
Up to nine comma-separated IDs of users to receive the message.