Skip to main content
Version: 5.7.0

SendMessage

Sends a message on behalf of the user. The content of the message can be anything - though be convention it should contain a text field for plaintext content.

ServiceOperation
messagingSEND_MESSAGE

Method Parameters

ParameterDescription
toProfileIdsAn array of recipients of the message.
contentJsonThe message content.

Usage

http://localhost:3000
string[] toProfileIds = { "profileId1", "profileId2" };
string contentJson = "{\"subject\":\"Chat and messaging features are here!\",\"text\":\"Check out the new chat and messaging features!\"}";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.MessagingService.SendMessage(toProfileIds, contentJson, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"actual": 1,
"requested": 1,
"msgId": "e541737c-3bfe-4680-a5c1-13c3b196e73a"
}
}
Common Error Code

Status Codes

CodeNameDescription
40601FEATURE_NOT_ENABLEDMessaging feature is not enabled for app.
40621MESSAGING_MAX_RECIPIENTS_EXCEEDEDMessage recipients count cannot exceed 5 (defaults to 5)