To use Push API you need to have individual User API token, which can be found in the settings of space.
You’ll see the block with User API token on the space settings page only in case if your tariff plan and access rights allow to use devtodev API. You can reset User API token or create it again on the same page.
Please attend, if you use several spaces, in every space user has individual User API token.
user_token - individual User API token of a user. It could be sent with both GET and POST methods.
v1 - the current version of API
Request content is sent with POST method in JSON format.
The body of a request can contain the following properties:
Required. An individual user API token. It can be found on the space settings page. It is possible to send it with both POST and GET methods.
Required. An application identifier. It can be found in the application’s settings in the Integration section. Required.
Optional. The name of a campaign. The grouping of statistics for the assessment of the efficiency of a campaign is made by the name of a campaign. The API Stats report can be found in the Push section.
Optional. The unique identifier of a request. It is specified by a developer. It is used for the filtering of repeated sendings of identical requests in case of the loss of connection, etc. Requests with the same identifier can't be repeated during 10 minutes after their sending.
Required. An array of mailing audience. The element of an array is an object with an individual for every platform set of user identifiers. It is allowed to specify several known identifiers for one user. The maximum number of elements of an array is 1000.
The lists of available identifiers can be found in the description to each platform.
An object containing a notification and its properties for the iOS platform.
An object containing a notification and its properties for the Android platform.
An object containing a notification and its properties for the Windows platform. Use this object for any version of Windows (Windows Phone 8.1, Windows Phone 10, Windows 8.1, Windows 10).
An object containing a notification and its properties for the Windows 10 / WP 10. Don’t use this object for sending to other versions of Windows.
An example of a request for sending a simple notification to an iOS device:
If a request is formed correctly and there are no obstacles for sending a notification to users, an answer is JSON of the following type:
audience (number) - the number of users found
successful (number) - the number of successfully sent notifications
erroneous (number) - the number of notifications rejected by the delivery service
error_details (array) - a detailed description of reasons of a delivery fail
In case there is an error in a request, an answer is made in the following format:
status_code (number) - a general status of an error
errors (array) - an array of error descriptions
code (number) - the exact code of an error from the table of errors