> For the complete documentation index, see [llms.txt](https://docs.hackle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hackle.io/en/crm-marketing/webhook-guide/use-cases/webhook-push-inbox.md).

# Configure Push Notification Inbox via Webhook

{% hint style="info" %}
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.
{% endhint %}

You can easily implement a notification inbox by leveraging Hackle's push campaigns and webhook.

### Before You Start

{% hint style="warning" %}
Push messages sent before the webhook campaign is configured will not be displayed in the notification inbox.
{% endhint %}

### 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:

<table><thead><tr><th width="251.94140625">Field</th><th width="127.6875">Type</th><th>Description</th></tr></thead><tbody><tr><td>push_message_key</td><td>Long</td><td>Contains the key value of the push message campaign.</td></tr><tr><td>platform</td><td>String</td><td>The platform type of the push message send target. (<code>ANDROID</code> or <code>IOS</code>)</td></tr><tr><td>push_token</td><td>String</td><td>The push token of the push message send target.</td></tr><tr><td>title</td><td>String</td><td>The push message title displayed to the customer.</td></tr><tr><td>push_message_body</td><td>String</td><td>The push message body content displayed to the customer.</td></tr><tr><td>push_message_action_type</td><td>String</td><td><code>APP_OPEN</code> or <code>DEEP_LINK</code> value.</td></tr><tr><td>push_message_action_value</td><td>String</td><td>Contains the deep link value if action_type is DEEP_LINK.<br>Otherwise it is an Empty String("").</td></tr><tr><td>debug</td><td>Boolean</td><td>Whether it is a test send. (true or false)</td></tr><tr><td>result</td><td>String</td><td>The push send request result code.</td></tr><tr><td>tag_keys</td><td>String</td><td>The tag values configured in the Dashboard.</td></tr></tbody></table>

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:

<table><thead><tr><th width="378.3046875">Name</th><th>Description</th></tr></thead><tbody><tr><td>SUCCESS</td><td>Upon successful transmission</td></tr><tr><td>DEDUP</td><td>When limited by the duplicate send restriction of a specific campaign</td></tr><tr><td>GLOBAL_FREQUENCY_CAPPED</td><td>When limited by the total campaign Frequency Capping setting</td></tr><tr><td>NOT_FOUND_PUSH_PROVIDER_CREDENTIALS</td><td>When push provider credentials are not found</td></tr><tr><td>INVALID_PUSH_PROVIDER_CREDENTIALS</td><td>When push provider credentials are invalid</td></tr><tr><td>INVALID_PUSH_TOKEN</td><td>When the push token is invalid</td></tr><tr><td>INTERNAL_ERROR</td><td>When a server error occurs</td></tr></tbody></table>

#### User Identifier

The $push\_send event collects one of the identifiers of the send target.

<table><thead><tr><th width="126.7734375">Field</th><th width="162.4453125">Type</th><th>Description</th></tr></thead><tbody><tr><td>userId</td><td>String(nullable)</td><td>The userId identifier of the push send target user</td></tr><tr><td>deviceId</td><td>String(nullable)</td><td>The deviceId identifier of the push send target user</td></tr></tbody></table>

![](/files/WPLbk3Mlmr6ZIm8k9fYJ)

### Configure the Webhook

Follow the steps below to set up the push notification inbox.

{% stepper %}
{% step %}
**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.

![](/files/wExRYddiqc8zVhwTzCPj)

![](/files/CIuDua6mX6m3pmMaqjn9)
{% endstep %}

{% step %}
**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.

![](/files/YMu0AMiBDPmxRuSehl1T)

**Body Settings**

Write the webhook Request Body using [Liquid syntax](https://shopify.github.io/liquid/).

We use the `$push_send` event properties and identifiers described above as-is.

**Request Body**

```
{
 "identifiers":{
 	"userId": "{{identifiers["$userId"]}}",
 	"deviceId":"{{identifiers["$deviceId"]}}"
 },
 "key": "{{event_properties["push_message_key"]}}",
 "platform": "{{event_properties["platform_type"]}}",
 "push_token": "{{event_properties["push_token"]}}",
 "title": "{{event_properties["push_message_title"]}}",
 "body": "{{event_properties["push_message_body"]}}",
 "actionType": "{{event_properties["push_message_action_type"]}}",
 "actionValue":"{{event_properties["push_message_action_value"]}}"
}
```

![](/files/RHho6tYj6KaslTpTH3CS)

If a property or identifier value used in personalization is `null`, it is replaced with `""`.
{% endstep %}

{% step %}
**Target Settings**

**Basic Setup - All Push Campaigns**

To display all push campaigns in the notification inbox, select **All Users** as the target.

![](/files/TkxXbRLvQ0HMnkIjWJOw)

**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.

![](/files/YQ4Bp6URfXBDfMnwl8qc)

{% hint style="warning" %}
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`.
{% endhint %}
{% endstep %}

{% step %}
**Send Settings**

Once the webhook campaign configuration is complete, you can review the summary.

Click `Save` and then click `Send Settings`.

![](/files/2Ap5JJ0z7zA2g7eFqa9H)

Select `Event-based` as the send type.

Set the trigger event to `$push_send`.

Then click `Add Filter` and add the following conditions.

| Key                | Value                     | Description                                                       |
| ------------------ | ------------------------- | ----------------------------------------------------------------- |
| 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.

![](/files/J7RKLLxCGVcguaUVgYwq)

**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`.

![](/files/QaESwY5XAyMoCEI4uaoz)

This webhook campaign is for sending data to the notification inbox.

Therefore, separate send restrictions are usually not required.
{% endstep %}

{% step %}
**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.

![](/files/89qVsaQJGSzRZhT6r3Dz)
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hackle.io/en/crm-marketing/webhook-guide/use-cases/webhook-push-inbox.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
