Setup

Understand how to setup webhooks

Setup Webhooks

Webhooks send an HTTP API request with information about the user i.e event or user properties.

To set up your first CleverTap webhook:

  1. Navigate to Settings > Engage > Channels> Webhooks.
  2. Click + Add Webhook.
  3. Configure the webhook template.

📘

HTTP Methods

The following four HTTP methods are available for webhooks templates:

  • POST
  • GET
  • DELETE
  • PUT
  1. Add a webhook Name and Destination URL. If you currently do not have an endpoint created on your server to receive the webhook, you can use requestcatcher.com to create an endpoint for testing purposes.
  2. Click Save.
  3. After you click Save, CleverTap sends the below payload to your configured endpoint.
{
   "is_test":true,
   "targetId":1234,
   "key_values":{
      "key":"value"
   },
   "profiles":[
      {
         "Identity":"UserId",
         "Email":"[email protected]",
         "push_token":"Token"
      },
      {
         "Identity":"UserId",
         "Email":"[email protected]",
         "push_token":"Token"
      },
      {
         "Identity":"UserId",
         "Email":"[email protected]",
         "push_token":"Token"
      },
      {
         "Identity":"UserId",
         "Email":"[email protected]",
         "push_token":"Token"
      },
      {
         "Identity":"UserId",
         "Email":"[email protected]",
         "push_token":"Token"
      }
   ]
}
  1. Once your endpoint responds with an HTTP status 200 OK, CleverTap will save the template.
606606

🚧

Webhook Errors

CleverTap sends the request and waits for three seconds for a response from the endpoint. If the endpoint URL fails to respond then CleverTap retries the request. If the retry attempt fails, the campaign stats page is updated with the error "Webhook Dispatch Failed."

Also, another probable cause for the error is if the webhook endpoint is temporarily unavailable or down.

Another option besides setting up an endpoint on your server to listen for CleverTap webhooks is using a partner tool for reporting certain events. Let us consider a sample use case for better understanding.

Use Case

For your recently published In-app rating campaign, you might want to capture details of customers who provide negative feedback. You can configure a webhook that captures details of all the customers submitting less than or equal to three ratings and create a support ticket for it on Zendesk. Creating the support ticket will help your customer support team to reach out to them.

Refer to this detailed integration guide that demonstrates how you can set up a webhook and create a CleverTap webhook campaign for reporting tickets on Zendesk based on customer ratings submitted.