Send one notification to one device of an app. You have to provide your MASTER secret in the Authorization header
Name | Description |
---|---|
account_id required | Your account unique identifier to access the API. This parameter is part of the authorization process |
app_id required | Your app unique identifier to access the API. This parameter is part of the authorization process |
subject required | Title of the push notification that will appear in the notification bar of the user's device. |
message_holder required | parameter containing the content of the message. this message can have interpolation's containers inserted as %{name_of_variable}. Example: "Hi, good morning %{name}". |
deliveries required | Parameter containing an array of hashes. those hashes contains two key-value elements, device_id and replacements . The device_id, user_id or contact_id that send the delivery. The replacements contains a hash with the values of the interpolation's containers. Example: [{ device_id: "550ab6a1a096734ce5000002", replacements: {"name": "Your Name"} }] |
start_now required | Parameter to schedule the deliveries with the date provided with the parameter start_at |
send_all_devices | If true, send all contact's devices, else send the last contact's device. Only available when use 'user_id' or 'contact_id' |
start_at | Parameter containing the date when the deliveries will be send. the date has to been formated following the ISO 8601. If the date introduced is before from now your deliveries will be send instantly |
alert | Parameter to set the title of the push notification. If it is blank, then we will send a silent push notification. (Only iOS) |
sound | Parameter to specify the file sound to play when a push notification is received. (Only iOS) |
url | Parameter to specify rich content in the push notification |
thumbnail_url | To send a big picture notification |
category_push | Interactive Notifications with Notification Actions, only the following strings are accepted: 'CATEGORY_OK', 'CATEGORY_EDIT', 'CATEGORY_FIND', 'CATEGORY_LIKE_DISLIKE', 'CATEGORY_LAUNCH', 'CATEGORY_REMIND', 'CATEGORY_DELETE', 'CATEGORY_FORBID', 'CATEGORY_LIKE_FOLLOW', 'CATEGORY_LIKE_SHARE', 'CATEGORY_SHARE', 'CATEGORY_SHOP', 'CATEGORY_YES', 'CATEGORY_ACCEPT', 'CATEGORY_SEND', 'CATEGORY_BUY', 'CATEGORY_SAVE' |
badge | iOS only. The number to display as the badge of the app icon. If this property is absent, the badge is not changed. To remove the badge, set the value of this property to 0. |
silent | iOS only. If true, means that when your app is launched in the background or resumed, application:didReceiveRemoteNotification:fetchCompletionHandler: is called. |
extra | Parameter to specify custom content that will be shown on delivery |
POST
/v2/account/:account_id/push/deliveries
Accept: application/json
Authorization: Token token={account.master_secret}
Content-Type: application/json
{
"app_id": "{{app_id}}",
"subject": "PushMsg",
"send_all_devices": true,
"url": "https://www.cendyncrm.com",
"thumbnail_url": "https://www.cendyncrm.com/assets/logo-light-daf5fc9918db1e811190d12aea30947d.png",
"category_push": "CATEGORY_FIND",
"message_holder": "Hello %{name}, this is a Push Notification",
"start_now": "true",
"alert": "Hi %{name}",
"silent": false,
"deliveries": [
{
"device_id": "{{device_id}}",
"replacements": {
"name": "John"
}
}
]
}
200
{
"deliveries": [
[
{
"valid": true,
"delivery_id": "550ab6a1a096734ce5000002",
"device_id": "5834114ff92ea112ad000001"
},
{
"valid": true,
"delivery_id": "550ab6a1a096734ce5000003",
"device_id": "5834167ff92ea112ad304059"
}
]
]
}