Configure Push Notification Inbox via Webhook
A notification inbox is a feature that collects various notifications received in an app or web service in one place. When a user misses a push notification or wants to see it again, they can go to the notification inbox to check it.
You can easily implement a notification inbox by leveraging Hackle's push campaigns and webhook.
Before You Start
Push messages sent before the webhook campaign is configured will not be displayed in the notification inbox.
Understanding the $push_send Event
This example uses the $push_send event, which is automatically collected when a push campaign is run in Hackle.
The $push_send event occurs when a push message send is requested.
In other words, the concept is to use the push message sending event as a trigger to send a webhook campaign.
$push_send
The event properties collected by the $push_send event are as follows:
push_message_key
Long
Contains the key value of the push message campaign.
platform
String
The platform type of the push message send target. (ANDROID or IOS)
push_token
String
The push token of the push message send target.
title
String
The push message title displayed to the customer.
push_message_body
String
The push message body content displayed to the customer.
push_message_action_type
String
APP_OPEN or DEEP_LINK value.
push_message_action_value
String
Contains the deep link value if action_type is DEEP_LINK. Otherwise it is an Empty String("").
debug
Boolean
Whether it is a test send. (true or false)
result
String
The push send request result code.
tag_keys
String
The tag values configured in the Dashboard.
You can check whether the send was successful through the result property value in the $push_send event.
The send request result codes are as follows:
SUCCESS
Upon successful transmission
DEDUP
When limited by the duplicate send restriction of a specific campaign
GLOBAL_FREQUENCY_CAPPED
When limited by the total campaign Frequency Capping setting
NOT_FOUND_PUSH_PROVIDER_CREDENTIALS
When push provider credentials are not found
INVALID_PUSH_PROVIDER_CREDENTIALS
When push provider credentials are invalid
INVALID_PUSH_TOKEN
When the push token is invalid
INTERNAL_ERROR
When a server error occurs
User Identifier
The $push_send event collects one of the identifiers of the send target.
userId
String(nullable)
The userId identifier of the push send target user
deviceId
String(nullable)
The deviceId identifier of the push send target user

Configure the Webhook
Follow the steps below to set up the push notification inbox.
Create a Webhook Campaign
Click + Create Campaign in the upper right corner of the Webhook menu in the Dashboard.
Enter the desired campaign name to create it.


Configure Request Information
Method Settings
Set the Method to POST.
Headers and Parameter Settings
Add authentication information, etc., in Headers to match the push notification inbox API specification.
Here we assume that the Authorization header uses the access-token from user properties.

Body Settings
Write the webhook Request Body using Liquid syntax.
We use the $push_send event properties and identifiers described above as-is.
Request Body

If a property or identifier value used in personalization is null, it is replaced with "".
Target Settings
Basic Setup - All Push Campaigns
To display all push campaigns in the notification inbox, select All Users as the target.

Advanced Setup - Specific Push Campaigns
To display only specific push campaigns in the notification inbox, configure the webhook cohort to match the target cohort of the push campaign.

Make sure to match the push campaign target and webhook campaign target.
The webhook campaign target must be the same as or broader than the push campaign target.
The safest approach is to set the webhook campaign target to All Users.
Send Settings
Once the webhook campaign configuration is complete, you can review the summary.
Click Save and then click Send Settings.

Select Event-based as the send type.
Set the trigger event to $push_send.
Then click Add Filter and add the following conditions.
push_message_key
(Push campaign key value)
(Optional) If you want to configure only a specific push campaign
result
SUCCESS
(Recommended) If you want to show only successfully sent messages
Basic Setup - All Push Campaigns
To display all push campaigns in the notification inbox, set only the result=SUCCESS condition.

Advanced Setup - Specific Push Campaigns
To display only specific push campaigns, add push_message_key along with result.
For example, to display only pushes with a message key value of 2, set push_message_key=2 and result=SUCCESS.

This webhook campaign is for sending data to the notification inbox.
Therefore, separate send restrictions are usually not required.
Complete
The webhook configuration for the push notification inbox is complete.
Now implement the notification inbox reception API to complete the push notification inbox feature.

Last updated