Send single Push notification
Use this method to send a single Push notification to one or multiple recipients.
Authorizations:
Request Body schema:
application/jsonfrom required | string [ 1 .. 80 ] characters PUSH Application Code you are using to send messages. Application Code is the application identifier which links your mobile application to the application profile created in Infobip Platform. It is required to insert the Application Code in Mobile Messaging SDK configuration once you implement it in your mobile application. | ||||||||||||||||||||||||||||||||||||||
to required | object Recipient destination address. Check examples how to work with recipients | ||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
text required | string [ 1 .. 4000 ] characters Text of the message that will be sent. | ||||||||||||||||||||||||||||||||||||||
validityPeriod | integer <int64> >= 0 The message validity period. Unless specified differently in | ||||||||||||||||||||||||||||||||||||||
validityPeriodTimeUnit | string Enum: "SECONDS" "MINUTES" "HOURS" Time unit for validity period. Defaults to hours. | ||||||||||||||||||||||||||||||||||||||
sendAt | string <date-time> Used for scheduled Push notifications. Message will be sent at scheduled time. Date and time when the message is to be sent. Has the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZ, and can only be scheduled for no later than 180 days in advance. | ||||||||||||||||||||||||||||||||||||||
customPayload | object Additional data that can be delivered with the Push message. customPayload must be formatted as JSON object. | ||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
notificationOptions | object JSON object that contains notification options. | ||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
notifyUrl | string The URL on your call back server on to which a delivery report will be sent. The retry cycle for when your URL becomes unavailable uses the following formula: | ||||||||||||||||||||||||||||||||||||||
notifyContentType | string Preferred Delivery report content type. Supported content types: application/json, application/xml. | ||||||||||||||||||||||||||||||||||||||
callbackData | string Additional client's data that will be sent onto | ||||||||||||||||||||||||||||||||||||||
targetOnlyPrimaryDevices | boolean Set to true to only send messages to push devices which are marked as primary devices. By default, messages will be sent to all targeted devices, including both primary and non-primary. |
Responses
OK
Bad request
Unauthorized
Forbidden
Internal Server Error
Request samples
- Payload
- cURL
- Java
- C#
- Go
- Python
- PHP
- JavaScript
- NodeJs
- Ruby
{- "from": "d417d38814740a23f50b5c876e226445-0f700564-abbf-4b5b-beae-86a4ef410904",
- "to": {
- "externalUserId": "customer_21234"
}, - "text": "This Message was sent by targeting exact externalUserId.",
- "validityPeriod": 30,
- "validityPeriodTimeUnit": "MINUTES",
- "customPayload": {
- "someData": "someData",
- "targetUrl": "www.someDomain.com"
}, - "notificationOptions": {
- "soundEnabled": false,
- "badge": 1,
- "category": "mm_accept_decline",
- "showInApp": true,
- "inAppExpirationPeriod": 6,
- "inAppExpirationTimeUnit": "MINUTES",
- "inAppDismissTitle": "Close",
- "inAppOpenTitle": "Show",
- "inboxTopic": "Promotion"
}, - "notifyContentType": "application/json",
- "callbackData": "DLR callback data"
}
Response samples
- 200
- 400
- 401
- 403
- 500
{- "bulks": [
- {
- "to": {
- "externalUserId": "customer_21234"
}, - "status": {
- "groupId": 1,
- "groupName": "PENDING",
- "id": 26,
- "name": "PENDING_ACCEPTED",
- "description": "Message accepted, pending for delivery"
}, - "messageCount": 1,
- "bulkId": "oungulj9xm9b3hixkupu"
}, - {
- "to": {
- "externalUserId": "customer_113456"
}, - "status": {
- "groupId": 1,
- "groupName": "PENDING",
- "id": 26,
- "name": "PENDING_ACCEPTED",
- "description": "Message accepted, pending for delivery"
}, - "messageCount": 1,
- "bulkId": "gby7cz3x6m244n2e4vzb"
}
]
}
Need assistance
Encountering issues
What's new? Check out
Unsure about a term? See