Chat
Chat is a new service that enables real-time communication between end-users. It is available to apps that have brainCloud RTT enabled.
This page describes the Chat Service S2S API methods. For the client api, go to Chat Service - Client API.
Chat Service - S2s API
These APIs call bypass channel membership / message ownership checks - and allow you to post messages from the system (i.e. app) instead of from another end-user:
- GetChannelId
- SysDeleteChatMessage
- SysGetChannelInfo
- SysGetChatMessage
- SysGetRecentChatMessages
- SysPostChatMessage
- SysPostChatMessageSimple
- SysUpdateChatMessage
These APIs are used for system channel operations:
API Summary
ChatService
These API calls bypass channel membership / message ownership checks - and allow you to post messages from the system (i.e. app) instead of from another end-user:
- GetChannelId - Gets the channelId for the given \<channelType> and \<channelSubId>. Channel type must be one of "gl" or "gr".
- SysCreateChannel - Initializes a dynamic or system chat channel. Returns the channelId. Channel type can be "dy" or "sy".
- SysDeleteChannel - Deletes a dynamic or system chat channel. Channel type can be "dy" or "sy". This will delete the chat history as well.
- SysGetChannelInfo - Gets description info and activity stats for channel \<channelId>. Note that numMsgs and listeners only returned for non-global groups. Only callable for channels the user is a member of.
- SysGetChatMessage - Gets a populated chat object (normally for editing).
- SysGetRecentChatMessages - Get a list of \<maxReturn> messages from history of channel \<channelId>
- SysPostChatMessage - Send a potentially rich chat message. \<recordInHistory> is optional and true by default. \<fromJson> is optional and can contain a "name" and/or "pic" entry.
- SysPostChatMessageSimple - Send a simple-text message. \<recordInHistory> is optional and true by default. \<fromJson> is optional and can contain a "name" and/or "pic" entry.
- SysUpdateChatMessage - Update a chat message. \<version> must match the latest or pass -1 to bypass version check.
- SysDeleteChatMessage - Delete a chat message. \<version> must match the latest or pass -1 to bypass version check.
📄️ GetChannelId
Retrieves a channel id given the specified lookup parameters.
📄️ SysChannelConnect
Connect to a chat channel.
📄️ SysChannelDisconnect
Disconnect from a chat channel.
📄️ SysCreateChannel
Initializes a dynamic or system chat channel. Returns the channelId. Channel type can be "dy" or "sy".
📄️ SysDeleteChannel
Deletes a dynamic chat channel. Channel type must be "dy". This will delete the chat history as well.
📄️ SysDeleteChatMessage
Delete the specified chat message. Message can be from any user (or the system). Version must match (or pass -1 to bypass version enforcement).
📄️ SysGetChannelInfo
Returns description info and activity stats for the specified channel. Note that numMembers, numListeners and listeners are only returned for non-global groups.
📄️ SysGetChatMessage
Retrieves a chat message object from history. If the message cannot be found, that data section returned will be empty.
📄️ SysGetRecentChatMessages
Returns a list of max \ messages from history.
📄️ SysPostChatMessage
Send a message on behalf of the system to the specified users.
📄️ SysPostChatMessageSimple
This method is available in Cloud Code scripts only.
📄️ SysUpdateChatMessage
Update the specified chat message. Message can have been from any user (or system). Version provided must match (or pass -1 to bypass version enforcement).