Webhooks

To enable this feature, contact customer support.

This topic describes how to use webhooks HTTP callback for sending event data in real time. to receive real-time event data about your mailings. You can create webhooks for the following events:

  • sent mailings
  • opens
  • clicks
  • bounces
  • unsubscribes
  • spam complaints

For example, you can use the data for notifications and analyses in external systems such as CRM Stands for "customer relationship management"; a system for managing interactions with current and future customers, including support for sales, marketing, customer service and technical services. software. You manage webhooks using the Optimizely Campaign REST API.

Creating webhooks

  1. Open the operation Create a webhook and click Try it out.

    Image: Try it out

  2. Enter the following information in the corresponding mandatory fields:
  3. Optionally, enter the following information if you want to submit the Basic HTTP Authentication header:
    • basicAuthUsername. User name.
    • basicAuthPassword. Password.
  4. Click Execute. If the creation was successful, you receive the HTTP response status code 201.

Retrieving webhook information

To retrieve information about a webhook, such as webhook ID, target URL, and event type, do the following:

  1. Open the operation Get information about all webhooks and click Try it out.
  2. In the clientId mandatory field, enter your client ID. To see the client ID, open the Optimizely Campaign menu and select Administration > API Overview > REST API.
  3. Click Execute.

You need the webhook ID for updating, verifying, activating, deactivating and deleting the webhook.

Updating webhooks

  1. Open the operation Update a webhook and click Try it out.
  2. Enter the following information in the corresponding mandatory fields:
    • clientID. Your client ID. To see the client ID, open the Optimizely Campaign menu and select Administration > API Overview > REST API.
    • webhookId. Webhook ID. You can retrieve the webhook ID with the operation Get information about all webhooks.
  3. Update the information as described in Creating webhooks.
  4. Click Execute. If the update was successful, you receive the HTTP response status code 200.

Verifying webhooks

To verify that the webhook is ready to use and can send event data to the specified URL Stands for "Uniform Resource Locator". Also known as a web address such as http://world.optimizely.com., do the following:

  1. Open the operation Verify a webhook and click Try it out.
  2. Enter the following information:
    • clientID. Your client ID. To see the client ID, open the Optimizely Campaign menu and select Administration > API Overview > REST API.
    • webhookId. Webhook ID. You can retrieve the webhook ID with the operation Get information about all webhooks.
    • mailinId. ID of a valid mailing, for example a test mailing in Smart Campaigns.
  3. Click Execute. If the verification was successful, you receive the HTTP response status code 200.

Activating webhooks

To export event data in real time, you must activate the corresponding webhook. Do the following:

  1. Open the operation Activate a webhook and click Try it out.
  2. Enter the following information in the corresponding mandatory fields:
    • clientID. Your client ID. To see the client ID, open the Optimizely Campaign menu and select Administration > API Overview > REST API.
    • webhookId. Webhook ID. You can retrieve the webhook ID with the operation Get information about all webhooks.
  3. Click Execute. If the activation was successful, you receive the HTTP response status code 200.

Event data

As soon as a mailing recipient performs an action, Optimizely Campaign sends the corresponding event data via a HTTP POST request to the target URL. The event data is sent in batches (lists) consisting of a maximum of 100 events each.

After successful data receiving, the target URL must return the HTTP response status code 200. Otherwise the export is retried every 10 seconds. If no data can be delivered three days after the event is created, the event is discarded.

Deactivating webhooks

If you no longer want to export event data, you must deactivate the webhook. The webhook still exists and you can reactivate it later. Do the following:

  1. Open the operation Dectivate a webhook and click Try it out.
  2. Enter the following information in the corresponding mandatory fields:
    • clientID. Your client ID. To see the client ID, open the Optimizely Campaign menu and select Administration > API Overview > REST API.
    • webhookId. Webhook ID. You can retrieve the webhook ID with the operation Get information about all webhooks.
  3. Click Execute.

Deleting webhooks

For example, if you no longer need a webhook or want to create new webhooks, but the creation limit per client is reached, you can delete webhooks. Do the following:

You can only delete deactivated webhooks. See Deactivating a webhook.

  1. Open the operation Delete a webhook and click Try it out.
  2. Enter the following information in the corresponding mandatory fields:
    • clientID. Your client ID. To see the client ID, open the Optimizely Campaign menu and select Administration > API Overview > REST API.
    • webhookId. Webhook ID. You can retrieve the webhook ID with the operation Get information about all webhooks.
  3. Click Execute.