Send Notifications
This section describes API to send push notifications.
Send Push
To send push notifications.
This API requires a JSON payload.
On success is returned an HTTP 200 and JSON like this:
HTTP Request
POST https://app.mpush.cloud/api/send
Parameters (JSON)
Key | Type | Required | Description |
push.topics | array | Yes | Contains a list of all topics to send the push to. |
push.payload.title | string | No | Notification title. |
push.payload.body | string | Yes | Notification body. |
push.payload.badge | int | No | Badge number. |
push.payload.sound | string | No | Specify the sound path to play when the push arrives. |
push.payload.title_loc_key | string | No | Specify the key to a body string in a localization file for the current locale. |
push.payload.title_loc_args | array | No | Specify the values to appear in place of the format specifiers in |
push.payload.loc_key | string | No | Specify the key to a title string in a localization file for the current locale. |
push.payload.loc_args | array | No | Specify the values to appear in place of the format specifiers in |
push.payload.action_loc_key | string | No | Custom sound to play. |
push.payload.launch_image | string | No | Specify the image path to launch at the app launch. |
push.payload.scheduled_at | int | No | A UNIX timestamp (UTC) that identifies the date when the notification should be sent. |
push.payload.mutable_content | bool | No | Mutable content (only iOS). |
push.payload.content_available | bool | No | Content available (only iOS). |
push.payload.category | string | No | Specify a category (only iOS). |
push.payload.thread_id | int | No | Specify a thread (only iOS). |
push.payload.collapse_id | int | No | Multiple notifications with the same collapse identifier are displayed to the user as a single notification (only iOS). |
push.payload.expiration_at | int | No | A UNIX timestamp (UTC) that identifies the date when the notification is no longer valid and can be discarded. |
push.payload.custom | object | No | An object containing custom data. |
This table is used the "dot" notation to show the payload JSON structure.
For a complete reference to all available values to include in the payload we remand to the official documentation: iOS and Android.
Examples
Payload example to send a basic notification:
Payload example to send a basic notification to multiple topics with custom badge and sound:
Payload example to send a scheduled notification with custom data:
Payload example to send a notification with localization:
In the sidebar a list of examples with the most common configurations.
Last updated