Skip to main content
Version: 6.0.0

SysPostChatMessage

tip

This method is available in Cloud Code scripts only.

Sends a potentially richer member chat message. By convention, content should contain a field named text for plain-text content. From is a json containing the message originator info - in this case normally "name" and potentially a "pic" url. Returns the id of the message created.

ServiceOperation
chatSYS_POST_CHAT_MESSAGE

Method Parameters​

ParameterDescription
channelIdThe chat channel to post to
contentJsonThe json content of the message
recordInHistorySet to false if the message shouldn't be recorded to history. Useful for sending non-conversational messages, like when users join a room, etc.
fromJsonthe from information for message. Should not include id.

Usage​

http://localhost:3000
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"data": {
"msgId": "783347769003570"
},
"status": 200
}
Common Error Code

Status Codes​

CodeNameDescription
40601RTT_NOT_ENABLEDRTT must be enabled for this feature
40603CHAT_UNRECOGNIZED_CHANNELThe specified channel is invalid
40616CLOUD_CODE_ONLYMethod only available via cloud code