Event registration
There are two schemes for registering push message delivery and opening events in Altcraft:
- Directly from the app.
- Through an intermediate service.
Registering events directly from the app
By default, when sending a push message, the hub_link object is included 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 app must execute a GET request to the ack and open links to register delivery and push opening, respectively.
Registering events through an intermediate service
caution
This method requires Extra UID in the push message user data (configurable on request)
The app reports the event to the intermediate service, passing the Extra UID from the push.
The gateway must send this event to Altcraft Platform 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 | Events |
| uid | string | "uid" | Yes | Comes along with the 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 |