Skip to main content

Send Notification

This request sends a push notification to one or more devices.

post /push/notifications

Recipients of the push notifications are added to the recipients array.

Sample

A sample POST request to send a notification to the devices with secure IDs listed in recipients:

curl -X POST \
'https://api.carrierx.com/core/v2/push/notifications' \
-H 'Content-Type: application/json' \
--data-binary '{"title": "Notification for two recipients", "body": "This is a test push notification for two registered devices.", "ttl": 5, "priority": "normal", "recipients": ["901dd79e-ff4f-4ff3-9b48-c095dfb4fcef", "16e64699-3064-463b-8dc7-96783c08a3d9"]}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response

200 status code with data about the notification:

{
"failure": 0,
"results": {
"16e64699-3064-463b-8dc7-96783c08a3d9": "success",
"901dd79e-ff4f-4ff3-9b48-c095dfb4fcef": "success"
},
"success": 2
}

Required Scopes

To send a notification the partner must have one of the following scopes enabled:

  • push.manage
  • push.create

Body Arguments

JSON representation of the fields and values of the Notification object to be created.

A required field to create a Notification object is recipients.

note

The number of recipients is limited to 100.

Refer to this table to view all fields that appear in the Notification object.