SendRichToSegments
This operation sends a template based message to multiple user targets.
Example of substitution usage:
Message could be You have won a {2} for entering the {1} contest
.
Substitutions parameter would be { "1" : "User Appreciation", "2", "User Appreciation Prize" }
Results
Name | Description |
---|---|
estimatedTargets | Estimate number of targeted users |
Service | Operation |
---|---|
pushNotification | SEND_RICH_TO_SEGMENTS |
Method Parameters
Parameter | Description |
---|---|
notificationTemplateId | Identifies the template that will determine the message content. |
segmentIdList | List of target segements. Omit to send to all users. |
substitutions | Positional message substitution values. |
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 notificationTemplateId = 1;
var substitutions = {
"0": "value0",
"1": "value1"
};
var segmentIdList = [
1,
2
];
var pushNotificationProxy = bridge.getPushNotificationServiceProxy();
var postResult = pushNotificationProxy.sendRichToSegments(notificationTemplateId, substitutions, segmentIdList);
if (postResult.status == 200) {
// Success!
}
{
"service": "pushNotification",
"operation": "SEND_RICH_TO_SEGMENTS",
"data": {
"notificationTemplateId": 1,
"segmentIdList": [
1,
2
],
"substitutions": {
"0": "value0",
"1": "value1"
}
}
}
JSON Response
{
"packetId": 1,
"messageResponses": [
{
"status": 200,
"data": {
"estimatedTargets": 1234
}
}
]
}