# Obtain Response Data via Webhook

Webhooks are used to obtain response data from Mandrill, such as whether your customer has subscribed or unsubscribed from your mailing. These data will be processed by CrossEngage and displayed in each campaign’s statistics. The generated data can be used to build [user segments](https://documentation.crossengage.io/faq/events/can-i-create-segments-based-on-events/event-segmentation-using-esp-integrations).

Your CrossEngage "Web tracking and response data API key" is needed for this Webhook configuration.

## Preparing a Webhook URL

To fetch the "Web tracking and response data API key":

* Log in to your CrossEngage account.
* Navigate to `Settings` > `System setup`.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2Faxn3Ui8ry2Aipp2XZS4l%2FSystemSetup.png?alt=media&#x26;token=44af739e-48d8-4235-900e-0fba92ef70e1" alt=""><figcaption></figcaption></figure>

* &#x20;In the `API keys` section, copy the “Web tracking and response data API key”.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2F41V9LvF2G5qWLsdX4PTW%2FSystemSetup_APIkeys.png?alt=media&#x26;token=86f1b6f9-b71f-4a9e-9c46-c33cbd5045ed" alt=""><figcaption></figcaption></figure>

* Paste your copied API key into the following URL instead of the placeholder "{webapikey}." &#x20;
  * ​[https://api.crossengage.io/mandrill/inbound/message/{webapikey](https://api.crossengage.io/mandrill/inbound/message/)}
* When finished, copy the adjusted URL.

## Adding a Webhook to Mandrill

Webhook URL must be added to Mandrill to allow response data to be sent to the CrossEngage System. This is done via the following steps:

* [*Log in*](https://mandrillapp.com/login/?referrer=%2F) to you Mandrill account.
* Click on the small arrow icon beside the "Settings" section in the left panel menu.
* Select the `Webhooks` tab.
* Click the `+Add a Webhook` button.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2Fn40Fm40bC94k3RYysnJB%2FMandrill_Webhook.png?alt=media&#x26;token=f5cce0e5-fc4d-4205-99ea-0da654d0fbe6" alt=""><figcaption></figcaption></figure>

* In the "Trigger on Events" section, tick all fields apart from:
  * Rejection Whitelist Changes
  * Rejection Blacklist Changes
* Paste the copied URL from the previous steps into the "Post To URL" field.
* Enter a descriptive Webhook name.
* Select `Create Webhook`.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2FXHzPNrCZolTwkAzAdI2u%2FMandrill_Webhook_1.png?alt=media&#x26;token=a73fdb3f-091f-44c4-afd4-dd0f2c4bf8f9" alt=""><figcaption></figcaption></figure>

### Blacklist Data Webhook

* If you would like to receive blacklist data Webhook only, click the `Add a Webhook` button.
* In the "Trigger on Events" section, select the following fields:
  * Rejection Blacklist Changes
  * Rejection Whitelist Changes
* Paste the copied URL from previous steps into the "Post To URL" field.
* Enter a descriptive Webhook name in the "Description" field.
* Select `Create Webhook`.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2F1MAap9HfT2Qp9B1dxF3Y%2FMandrill_Webhook_2.png?alt=media&#x26;token=3150c982-8f98-4374-8ca9-710afac02685" alt=""><figcaption></figcaption></figure>

You will now be able to view response data in your CrossEngage dashboard and use the information to build segments.
