SysSendMessage
Sends a message on behalf of the system (i.e. app) to the specified users.
Service | Operation |
---|---|
messaging | SYS_SEND_MESSAGE |
Method Parameters
Parameter | Description |
---|---|
toProfileIds | The array of recipients. |
contentJson | The json content object to send in the message. |
fromJson | Who the message is from. Should contain at least "name" field, and potential "pic" field as well. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var toProfileIds = [
"profileId1",
"profileId2"
];
var contentJson = {
"subject": "Upcoming features!",
"text": "Chat and messaging features are here!"
};
var fromJson = {
"id": null,
"name": "App Administrator"
};
var messagingProxy = bridge.getMessagingServiceProxy();
var postResult = messagingProxy.sysSendMessage(toProfileIds, contentJson, fromJson);
if (postResult.status == 200) {
// Success!
}
{
"service": "messaging",
"operation": "SYS_SEND_MESSAGE",
"data": {
"toProfileIds": [
"profileId1",
"profileId2"
],
"contentJson": {
"subject": "Upcoming features!",
"text": "Chat and messaging features are here!"
},
"fromJson": {
"id": null,
"name": "App Administrator"
}
}
}