Welcome to WebEngage WebHooks. WebHook lets you add a "HTTP callback" to the events happening in WebEngage, related to any system or application events. By configuring a WebHook, WebEngage is triggered to call a script on your web-servers whenever a particular event, for which you want to get a real-time data, occurs and use it for internal purpose. For example, real-time pushing feedback and replies from WebEngage to internal CRM system or triggering your own business logic.

Request Details

WebHook requests will be posted to a configured URL and format for a specific WebHook. WebHook request method will always be POST. There will be additional parameters that will be appended to the postURL.

Headers

Name Description
x-request-id:{HEX_STRING} This header is used to identify the webHook post requests uniquely to achieve events idempotency. {HEX_STRING} will be replaced with a unique random hex string

Parameters

Name
Description

eventType

Event for which data is being posted

licenseCode

Your WebEngage Publisher LicenseCode

secret

This secret key is to be used to identify the webHook post requests from WebEngage. More about this here

Request Body

Request body will contain the event specific data. The request body will vary based on the registered WebHooks.

Expected Response

WebEngage will understand HTTP Status, of the response. For HTTP Status 200 will be treated as Successful posts, everything else will be logged as failed WebHook posts.
See this to understand, what happens in case of failures.

Verifying Request

You will get a WebHook Secret Key for your account on the WebHook Configuration page. This secret key is to be used to identify the WebHook post requests from WebEngage to your servers. WebEngage appends secret parameter in the postURL see here. Value of the secret parameter is the MD5 Hex of the combination of the licenseCode and the WebHook Secret Key key separated by a :

Error Handling and Retries

We keep a log of recent WebHook Requests under WebHook History tab in the dashboard. We currently do not support automatic retries. To see the logs and manage failed requests, you will need to go to your WebHook History from there you will be able to resend a particular failed WebHook Requests by clicking the resend link against that history item.

Configuration

In your WebEngage Dashboard, you will be able to configure URLs for different events. Following are the WebHooks we currently allow you to configure.

Feedback WebHook

Triggers on feedback submission. To add a WebHook specific to FEEDBACK_SUBMIT event, you need to configure this WebHook by specifying the postURL and the response format again from xml & json.
Example of how the feedback data looks like. XML JSON

Feedback Reply WebHook

Triggers on posting a reply to an existing feedback thread. To add a WebHook specific to FEEDBACK_REPLY_SUBMIT event, you need to configure this WebHook by specifying the postURL and the response format again from xml & json.
Example of how the feedback reply data looks like. JSON

Survey Response WebHook

Triggers on survey response submission. To add a WebHook specific to SURVEY_RESPONSE_SUBMIT event, you need to configure this WebHook by specifying the postURL and the response format again from xml & json.
Example of how the survey response data looks like. XML JSON

Events WebHook

Triggers when the specified event gets logged into the system. To add a WebHook specific to an event, you need to configure this WebHook by specifying the name of the event, the postURL. Currently only json response format is supported.

Here is an example of how the event data for push_notification_accepted event looks like

{
    "event_data": {
        "result": "SUCCESS" // push-notification sent succefully
    },
    "system_data": {
        "variation_id": "1if30if",
        "sdk": "ANDROID",
        "scope":"~7l798ci",
        "id": "20hlgbg",
        "push_notification_content": "{\"identifier\":\"1if30if\",\"experimentId\":\"20hlgbg\",\"packageName\":null,\"title\":\"Master App\",\"message\":\"How are you today ?\",\"image\":null,\"cta\":{\"id\":\"3d7630c9\",\"type\":\"DEEP_LINK\",\"actionLink\":\"webengage://com.webengage.testapp1/start_activity/com.webenagege.testapp1.Activity1\",\"actionText\":null,\"templateId\":null},\"custom\":[{\"key\":\"theKey\",\"value\":\"whatIsKey\"}],\"expandableDetails\":{\"title\":null,\"image\":\"https://webengage.net/wk-test-static-files/~99199077/6313a242-91a5-46b8-96b5-1598365a509a.jpg\",\"message\":null,\"cta1\":null,\"cta2\":null,\"cta3\":null,\"style\":\"BIG_PICTURE\",\"category\":null},\"tokens\":null}"
    },
    "event_time": "2016-06-01T15:53:59+0000",
    "event_name": "push_notification_accepted",
    "license_code": "~99199077",
    "category": "system",
    "user_id": "chirag@webklipper.com",
    "anonymous_id": "0000014a-a2da-cfd3-91c7-0252d7df1a4c"
}

Here is an example of how the event data for push_notification_rejected event looks like

 {
     "event_data": {
         "result": "UNAVAILABLE"
     },
     "system_data": {
         "variation_id": "1if30if",
         "sdk": "ANDROID",
         "scope":"~7l799ci",
         "id": "20hlgbg",
         "push_notification_content": "GCM_ERROR"
     },
     "event_time": "2016-06-01T15:53:58+0000",
     "event_name": "push_notification_rejected",
     "license_code": "~99199077",
     "category": "system",
     "user_id": "chirag@webklipper.com",
     "anonymous_id": "0000014a-a2da-cfd3-91c7-0252d7df1a4c"
 }

Journey WebHook

Triggers on Journey crud events. To add a WebHook specific to JOURNEY, you need to configure this WebHook by specifying the postURL. JSON format supported.

Here is an example of how the event data for journey_activated event looks like

{
    "category": "account",
    "resource": "Journey",
    "version": 1,
    "event_name": "journey_activated",
    "event_time": "2017-03-06T11:00:52+0000",
    "license_code": "311c48b3",
    "user_id": "john@doe.com",
    "event_data": {
        "creationTime": "2017-03-06T11:00:52+0000",
        "createdBy": "john@doe.com",
        "name": "Repeat Order Journey",
        "id": "abn3jj5",
        "activatedBy": "john@doe.com",
        "activationTime": "2017-03-06T11:00:52+0000",
        "status": "ACTIVE",
        "tags": ["premium-user"]
    }
}

WebHooks