Event registration
There are two ways to register delivery events and open push messages in Altcraft MP:
- Directly from the app.
- Through a third-party service.
Registering events directly from the app
By default, when sending a push message, the "hub_link"
object is sent in the payload:
{
"hub_link" : {
"ack" : "http://your.domain.com/api/v1.1/pushes/crypto_post_events?/2ab9162159..." ,
"open" : "http://your.domain.com/api/v1.1/pushes/crypto_post_events?/555fbe0b9..."
}
}
The application must execute a GET request using the rack and open links to register the delivery and open the push, respectively.
Registering events through a third-party service
caution
This method requires the presence of Extra UID in the user data of the push message (configurable on request).
The application informs the third-party service about the event and at the same time transfers Extra UID from the push.
The gateway must send this event to Altcraft MP via API.
URL
Method: POST
https://example.com/api/v1.1/pushes/post_events
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
events | int | 1 — delivered 2 — opened 3 — delivered and opened | Yes | Event |
uid | string | "uid" | Yes | Comes along with a push message from Altcraft in the Data payload. |
Request example
{
"token" : "abcdefghijklmnqrstuvwxyz" ,
"events" : 1,
"uid" : "e|2_4S_4HFn8RDhhmA|w4HFn8RPDFUi_2_4S_S_3___6.2NvyN8Hb67wmzJshM_6BuFTt|ios-apns"
}
Response example
{
"error" : 0,
"error_text" : "Successful operation"
}
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |