Skip to main content
Version: 5.7.0

Messaging

Messaging is a new service that enables rich communications between end-users. It is available to all Plus plan subscriptions - and can optionally utilise brainCloud RTT to send messages in real-time.

Key concepts:

  • used for directly addressed messages (via profileIds) - as opposed to Chat messages, which are sent to channels
  • is not email (though it is modelled similarly)
    • messages are sent within brainCloud only
    • and only within a single app
  • three types of messages - regular, system and bulk
    • regular messages - sent by end-users.
    • system messages - sent from the system (i.e. the app) - so the from field is null
    • bulk messages - system messages sent to all users (NOT YET SUPPORTED - COMING SOON!)
  • sends real-time events to online users when messages are received (if brainCloud RTT is enabled)

Message content format

{
"msgbox": "inbox",
"msgId": "<guidA>",
"mbCr": 1530070436834,
"mbUp": 1530070436834,
"mbVer": 1,
"message": {
"from": {
"id": "<profileIdA>",
"name": "Holly Leung",
"pic": "<optionalPicUrl>"
},
"to": [
"<profIleIdB>"
],
"sentAt": 1530070436834,
"content": {
"subject": "optional",
"text": "This is a test message"
}
}
}

Message fields

ParameterDescription
msgboxThe box (inbox, sent) that the message is stored in
msgIdThe chat message id (used for editing / deleting posted messages)
mbCrCreated at date+time in millis
mbUpLast updated date+time in millis
mbVerThe version of the message
fromInformation about the originating user
toArray of message recipients
sentAtTime+date in millis at which the message was sent
contentThe message content. If plaintext, should contain a text field

API Summary

Retrieving messages

Sending messages

Updating messages

Sys API Calls

These APIs target the shared content portion of a message, and not the per-user messagebox metadata (which controls whether a message has been read, etc.). Can be used on user or system messages.

Available via cleint session cloud code, as well as S2S.

Retrieving messages

Sending messages

Updating messages