Push#
Push Notifications Sending#
Text sending and additional parameters are available in push notifications.
Examples of additional parameters:
title;
images;
buttons;
HTML pages;
templates for sending sensitive data;
parameters for data enrichment;
data without preprocessing (in JSON format);
client data for statistics;
data for updating Live Activity;
primary application attribute;
mobile app subscriptions;
providers indication (APNS, FCM, HMS, RuStore) for sending data.
Request Examples#
Request examples to send push notifications.
To generate a test request with your parameters, please
open the request generator.
Description of useTimeDiff ; destAddr parameters.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"8770630",
5 "extraParam":"param1=value1,param2=value2",
6 "registeredDelivery":"1",
7 "notifyUrl":"URL_for_sending_statuses"
8 "useTimeDiff":true,
9 "scheduleInfo":{
10 "timeBegin":"10:00",
11 "timeEnd":"12:00",
12 "weekdaysSchedule":"123",
13 "deadline": "2029-12-31T16:29:30+0300"
14 },
15 "destAddr":"Subscriber's_Number",
16 "message":{
17 "type":"Push",
18 "data":{
19 "externalUserId": "subscriber's_ID",
20 "text":"Notification text",
21 "serviceNumber":"SENDER'S_NAME",
22 "ttl":10,
23 "ttlUnit": "SECONDS",
24 }
25 }
26 }
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"8770631",
5 "destAddr":"Subscriber's_Number",
6 "message":{
7 "type":"PUSH",
8 "data":{
9 "text":"Notification text",
10 "serviceNumber":"SENDER'S_NAME",
11 "ttl":2
12 }
13 }
14 }
Description of the title parameter.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"8770631",
5 "destAddr":"Subscriber's_Number",
6 "message":{
7 "type":"PUSH",
8 "data":{
9 "title":"Push notification header",
10 "text":"Notification text",
11 "serviceNumber":"SENDER'S_NAME",
12 "ttl":2
13 }
14 }
15 }
Description of the primaryOn parameter.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"8770631",
5 "destAddr":"Subscriber's_Number",
6 "message":{
7 "type":"PUSH",
8 "data":{
9 "text":"Notification text",
10 "primaryOn":true,
11 "serviceNumber":"SENDER'S_NAME",
12 "ttl":2
13 }
14 }
15 }
In this example the message is transmitted over the client’s externalUserId.
Description of the contentCategory parameter.
1 {
2 "login": "YOUR_LOGIN",
3 "password": "YOUR_PASSWORD",
4 "id": "9999992",
5 "message": {
6 "type": "PUSH",
7 "data": {
8 "externalUserId": "Subscriber's_ID",
9 "text": "Message_text",
10 "serviceNumber": "0000",
11 "ttl": 40,
12 "ttlUnit": "SECONDS",
13 "content": {
14 "contentCategory": "IMAGE",
15 "contentUrl": "https://i.pinimg.com/originals/11/ab/14/11ab147894a7d2ce866ff88a4aa63655.jpg"
16 }
17 }
18 }
19 }
In this example the message is transmitted over the client’s externalUserId.
Description of contentCategory ; actions parameters.
1 {
2 "login": "YOUR_LOGIN",
3 "password": "YOUR_PASSWORD",
4 "id": "9999992",
5 "message": {
6 "type": "PUSH",
7 "data": {
8 "externalUserId": "Subscriber's_ID",
9 "text": "Message_text",
10 "serviceNumber": "0000",
11 "ttl": 40,
12 "ttlUnit": "SECONDS",
13 "content": {
14 "contentCategory": "IMAGE",
15 "contentUrl": "https://i.pinimg.com/originals/11/ab/14/11ab147894a7d2ce866ff88a4aa63655.jpg",
16 "actions": [
17 {
18 "title": "Open",
19 "action": "link",
20 "options": "https://doc.rapporto.ru/"
21 },
22 {
23 "title": "Open application",
24 "action": "open-app",
25 "options": ""
26 }
27 ]
28 }
29 }
30 }
31 }
Description of the contentCategory parameter.
1 {
2 "login": "YOUR_LOGIN",
3 "password": "YOUR_PASSWORD",
4 "id": "9999992",
5 "destAddr":"Subscriber's_Number",
6 "message": {
7 "type": "PUSH",
8 "data": {
9 "text": "Message_text",
10 "serviceNumber": "0000",
11 "ttl": 40,
12 "ttlUnit": "SECONDS",
13 "content": {
14 "contentCategory": "HTML",
15 "contentUrl": "https://i.pinimg.com/originals/11/ab/14/11ab147894a7d2ce866ff88a4aa63655.jpg"
16 }
17 }
18 }
19 }
Description of the deviceSubscriptions parameter.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"8770631",
5 "destAddr":"Subscriber's_Number",
6 "message":{
7 "type":"PUSH",
8 "data":{
9 "externalUserId":"Subscriber's_ID",
10 "text":"Текст",
11 "serviceNumber":"SENDER'S_NAME",
12 "ttl":24,
13 "ttlUnit":"HOURS",
14 "deviceSubscriptions":[
15 "card"
16 ]
17 }
18 }
19 }
Description of the customPayload parameter.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"8770631",
5 "destAddr":"Subscriber's_Number",
6 "message":{
7 "type":"PUSH",
8 "data":{
9 "title":"Push message header",
10 "text":"Notification_text",
11 "serviceNumber":"SENDER'S_NAME",
12 "ttl":1,
13 "ttlUnit":"MINUTES",
14 "customPayload":{
15 "list":"card"
16 }
17 }
18 }
19 }
Description of the callbackData parameter.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"8770631",
5 "destAddr":"Subscriber's_Number",
6 "message":{
7 "type":"PUSH",
8 "data":{
9 "title":"Push message header",
10 "text":"Notification_text",
11 "serviceNumber":"SENDER'S_NAME",
12 "ttl":1,
13 "ttlUnit":"MINUTES",
14 "callbackData":"Data_for_statistics"
15 }
16 }
17 }
Parameters for an alternative sending data with content for a mobile application.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"4560",
5 "message":{
6 "type":"PUSH",
7 "data":{
8 "externalUserId":"Subscriber's_ID",
9 "title":"Previous_header",
10 "text":"Previous_text",
11 "serviceNumber":"SENDER'S_NAME",
12 "ttl":30,
13 "ttlUnit":"SECONDS",
14 "extraOptions":[
15 {
16 "param_name":"RICH",
17 "param_value":{
18 "title":"New_header",
19 "message":"New_text"
20 }
21 }
22 ]
23 }
24 }
25 }
Parameters to update Live Activity on iOS devices.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"4560",
5 "message":{
6 "type":"PUSH",
7 "data":{
8 "externalUserId":"Subscriber's_ID",
9 "title":"Header",
10 "text":"Text",
11 "serviceNumber":"SENDER'S_NAME",
12 "ttl":30,
13 "ttlUnit":"SECONDS",
14 "Options":[
15 {
16 "param_name":"LIVE_ACTIVITY",
17 "param_value":{
18 "aps":{
19 "timestamp":"2024-03-29T17:23:47.720Z",
20 "event":"update",
21 "content-state":{
22 "deliveryStatus":2,
23 "deliveryTime":5
24 }
25 }
26 }
27 }
28 ]
29 }
30 }
31 }
Parameters to send sensitive data in a push notification.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"4560",
5 "message":{
6 "type":"PUSH",
7 "data":{
8 "primaryOn":false,
9 "externalUserId":"Subscriber's_ID",
10 "title": "Code to receive %data%",
11 "text":"%name%, your card with number %card% is ready for issue",
12 "serviceNumber":"SENDER'S_NAME",
13 "ttl":30,
14 "ttlUnit":"SECONDS",
15 "Options":[
16 {
17 "param_name":"SECURE",
18 "param_value":{
19 "name":"Name",
20 "card":"*0000",
21 "data":"12345"
22 }
23 }
24 ]
25 }
26 }
27 }
Parameters to send push notifications to certain types of platforms (APNS, FCM, HMS, RuStore) at the request of the Partner.
1 {
2 "login":"YOUR_LOGIN",
3 "password":"YOUR_PASSWORD",
4 "id":"1",
5 "message":{
6 "type":"PUSH",
7 "data":{
8 "serviceNumber":"Service_sender's_name",
9 "externalUserId":"Subscriber's_ID",
10 "text":"Message_text",
11 "title":"Message_header",
12 "ttl":24,
13 "ttlUnit":"HOURS",
14 "Options":[
15 {
16 "param_name":"SENDING_PLATFORMS",
17 "param_value":[
18 "Android",
19 "Ios",
20 "RuStore"
21 ]
22 }
23 ]
24 }
25 }
26 }
Request Parameters#
Parameter |
Required |
Data type |
Description |
|---|---|---|---|
login |
yes |
string |
Partner’s name in the system. |
password |
yes |
string |
Partner’s password in the system. |
extraParam |
no |
string |
Additional parameters passed as
More details
The comma character cannot be included in the parameter name, but
it can be included in its value — in this case it must be doubled.
Example: the string
|
useTimeDiff |
no |
boolean |
Taking into account the time zone when starting messaging. More details
If
If
Default value: |
scheduleInfo |
no |
object |
Messaging schedule. More detailsIf it is not specified, it is sent immediately upon receipt of the request. |
scheduleInfo/timeBegin |
no |
string |
Start time. More details
Example: |
scheduleInfo/timeEnd |
no |
string |
End time. More details
Example: |
scheduleInfo/
weekdaysSchedule
|
no |
string |
Messaging days. More details
Specified by numbers from If there are no restrictions on days of the week, this parameter can be empty or not delivered in the request. |
scheduleInfo/deadline |
no |
string |
End date of the messaging. More details
Example: |
id |
no |
string |
Partner-side unique ID. More detailsThis parameter is required to control re-sending and duplication (the control service is enabled separately). The Partner may recall the Service Provider (the request to send a message) with the same ID several times. In this case the message will be sent to the subscriber only once (upon the first request). In response to requests, the Service Provider will return the same message ID in the Service Provider's system to the Partner (the same as for the first request). The Service Provider optionally returns this ID to the Partner, if available in the message delivery report. |
shortenLinks |
no |
boolean |
Parameter enables automatic shortening of URL strings in the message. More detailsPossible values are:
If the parameter is not received in the request, but the service is available to the Partner, the links will be shortened by default. For more details: Link Shortening Service. Note The ability to use this service is previously agreed with and configured by the Service Provider. |
destAddr |
no |
string |
Subscriber’s phone number. More details
Mandatory in case of push message if the
It contains the country code, operator code and phone number.
For the Russian Federation, the code
Examples: |
message |
yes |
object |
Parameters of a message being sent. |
message/type |
yes |
enum |
Message type. The value of PUSH is transmitted. |
message/data |
yes |
object |
Parameters of the data being sent. |
message/data/
externalUserId
|
no |
string |
User ID to send push messages (login, email, UID). |
message/data/ttl |
no |
integer |
Message lifetime. Acceptable range in seconds: from 30 to 86400. More detailsAcceptable range in seconds: from 30 to 86400. Note When If
|
message/data/ttlUnit |
no |
enum |
Unit of measurement of the message delivery period. More details
It is transmitted only with Possible values are:
|
message/data/
serviceNumber
|
no |
string |
Sender’s name from which the message is being sent. |
message/data/text |
yes |
string |
Message text. More detailsMaximum length: 1000 characters. |
Request with a header title |
|||
message/data/title |
no |
string |
Header of the text message. More detailsAmount of characters is no more than: 80. |
Request with the primary application attribute (primaryOn) |
|||
message/data/
primaryOn
|
no |
boolean |
Indication of the primary application installed on the subscriber’s device. More detailsPossible values are:
If the parameter is missing, it is also sent to all user devices. |
registeredDelivery |
no |
integer |
Requirement of delivery reports. More detailsPossible values are:
|
notifyUrl |
no |
string |
Hostname of the incoming API to obtain the delivery report (see Delivery Status Service). More detailsThis parameter is optional in the request, but when sending you need to consider the following:
If any of the specified conditions are not met, an error will be generated and the request will not be executed. |
Request specifying the category of content – images, HTML links and buttons (contentCategory) |
|||
message/data/content |
no |
object |
Parameters for sending images, HTML links and buttons. |
message/data/
content/
contentCategory
|
no |
enum |
Content category by the contentUrl link. More detailsPossible values are:
|
message/data/
content/contentUrl
|
no |
string |
URL of the image or HTML. More detailsMaximum link length: 512 characters.
Image requirements to
|
Request to display buttons (actions) |
|||
message/data/
content/actions
|
no |
array |
Array containing buttons.
The description of the button attributes is given in the tabLe below.
More detailsThe buttons allow to:
|
message/data/
content/actions/
title
|
no |
string |
Inscription on the button. More detailsAmount of characters: no more than 64. |
message/data/
content/actions/
action
|
no |
string |
Text ID of the button in the mobile application. More detailsIt defines the action to be performed when the button is clicked. The parameter is configured in the mobile application. Amount of characters: no more than 64. Possible values are:
|
message/data/
content/actions/
options
|
no |
string |
Additional button parameters. More detailsThe set depends on the OS and is determined by the developer of the mobile application. The parameter is configured in the mobile application. Number of characters: no more than 300.
In case of a button with |
Request with subscriptions (deviceSubscriptions) |
|||
message/data/
deviceSubscriptions
|
no |
array |
Transmitted array with a list of mobile app subscriptions. |
Request with data for the application (customPayload) |
|||
message/data/
customPayload
|
no |
JSON Object |
Data which are transmitted in its original form for further use in the mobile application. |
Request with data for statistics (callbackData) |
|||
message/data/
callbackData
|
no |
string |
Client data for statistics. More detailsThey are saved in the transmitted form upon receipt, an output in statistical data is possible, if necessary. |
Request with enriched data (extraOptions) |
|||
message/data/
extraOptions
|
no |
array |
Array of additional data objects from the partner. More details
It contains two mandatory parameters: |
message/data/
extraOptions/
param_name
|
yes |
string |
Transmission of the message attribute. More detailsPossible values are:
|
message/data/
extraOptions/
param_value
|
yes |
string |
Depending on the attribute passed to |
param_name=RICH |
|||
message/data/
extraOptions/
param_value/title
|
no |
string |
Header of the message. More detailsIf this parameter is received, the sent header is replaced or the header is set instead of an empty one. |
message/data/
extraOptions/
param_value/message
|
no |
string |
Message text. Подробнее
If it is sent in |
message/data/
extraOptions/
param_value/
content-category
|
no |
string |
Content type. More details
If it is sent, it is replaced along with the url. If the URL is
empty, the |
message/data/
extraOptions/
param_value/
content-url
|
no |
string |
Link for the content. More detailsIf the content type is not specified, it is substituted as a url instead of the sent one. If the url is not sent and the content type has not been sent, it is ignored. |
message/data/
extraOptions/
param_value/
custom-payload
|
no |
string |
User data. More detailsIf they are sent, the previously sent data are replaced or new data are set if they were not sent earlier. |
message/data/
extraOptions/
param_value/actions
|
no |
array |
List of buttons. More detailsIf the data is not empty, then the previously sent content is replaced. |
param_name=LIVE_ACTIVITY |
|||
message/data/
extraOptions/
param_value/aps/
stale_date
|
no |
timestamp |
timestamp in ISO 860 format — date and time when Live Activity is considered obsolete. |
message/data/
extraOptions/
param_value/aps/
dismissal_date
|
no |
timestamp |
timestamp in ISO 8601 format — date and time when Live Activity closes on the lock screen. More detailsAfter the widget stops being active, it can remain on the lock screen for another 4 hours if it is not closed. To close it immediately and not wait, you can specify a date that has already passed. |
message/data/
extraOptions/
param_value/aps/
timestamp
|
yes |
timestamp |
timestamp in ISO 8601 format. |
message/data/
extraOptions/
param_value/aps/
event
|
yes |
string |
Event for updating the Live Activity. More detailsThis parameter can take the following values:
|
message/data/
extraOptions/
param_value/aps/
content_state
|
no |
object |
Data that will be displayed in the Live Activity widget. More detailsThe widget developer sends these parameters. This block is not validated. The following data is realized in demo application:
|
param_name=SECURE |
|||
message/data/
extraOptions/
param_value
|
no |
string |
Names of parameters with sensitive data ( More detailsWhen sending via cloud providers, sensitive data transmitted in a push notification is masked using templates (substitutions in the text and in the title of the notification). Requirements for naming parameters with data for substitution:
In the example above (a request with enriched
These values must be passed in |
param_name=SENDING_PLATFORMS |
|||
message/data/
extraOptions/
param_value
|
no |
string |
List of names of providers to which you need to send messages. More detailsPossible values are:
|
Response to the Request#
After sending a message the Service Provider returns a response synchronously. In case of successful sending the Service Provider returns HTTP-code 200 OK.
Successful Sending#
1 {
2 "mtNum": "7390612217"
3 "id": "8770599"
4 }
Parameter |
Data type |
Description |
|---|---|---|
mtNum |
string |
Sending chain identifier assigned by the Service Provider platform. |
id |
string |
Partner-side unique ID. Available, if it was included when sending. |
Sending Errors#
For results with errors, a response HTTP code will differ from 200 (see Error Codes).
1 {
2 "error": {
3 "code": 1,
4 "description": "Service is unavailable"
5 }
6 }
Parameter |
Data type |
Description |
|---|---|---|
error |
object |
Error information. |
error/code |
int |
Error code. |
error/description |
string |
A brief description of the error. |
extendedDescription |
string |
Detailed description of the error (optional parameter). |
Error Codes#
Code |
Description |
HTTP-code |
|---|---|---|
1 |
Service is unavailable |
503 |
2 |
Invalid IP-address |
403 |
3 |
Too many connections |
429 |
4 |
Invalid request |
400 |
5 |
Invalid login |
401 |
6 |
Invalid password |
401 |
7 |
serviceNumber is not defined |
400 |
8 |
destAddr is not correct |
406 |
9 |
Message type is not correct |
406 |
10 |
Prohibited sending duplicates |
409 |
11 |
Invalid TTL |
406 |
100 |
100 |
500 |
Push Notification Delivery Statuses#
To receive statuses of push notifications, you need to set up the Delivery Status Service.
Delivery Error Codes#
Delivery error codes for each message type are provided in the corresponding tab of the Description of Error Codes (parameter status=5) section.