Webhook Slack Alerts

Understand how to send slack alerts for your CleverTap webhook campaign.

Overview

You can set up Slack alerts for your CleverTap Webhook campaign every time a user performs a specific event. For example, you may need to post a Slack alert whenever a user makes a high-value purchase.

To set up these Slack alerts for your webhook campaign, you need to perform three major steps:

  1. Enable incoming webhooks in your workspace
  2. Save the Webhook Endpoint URL
  3. Configure and Setup a Webhook campaign on CleverTap to send Slack alerts

Enable Incoming Webhooks In Your Workspace

To enable the incoming webhook alerts in Slack:

  1. Navigate to Apps from your Slack workspace and search for incoming webhooks in the search bar.
  2. Click Add under the Incoming WebHooks app.
18921892

The Slack App Directory page opens.

  1. Click Add to Slack.
13301330

📘

Admin Permissions

If your Slack workspace is managed by admins, you will need to raise a request for adding incoming webhooks to your Slack workspace.

  1. On the same screen, after you click Add to Slack, select a channel where you want to post the Slack alerts from the dropdown or create a new one, and click Add Incoming WebHooks integration.
16801680

Save the Webhook URL

After selecting the channel to post your alerts, Slack generates a webhook URL for that specific channel.

21142114

Copy and save that webhook URL in a file, as you will need it while configuring the webhook campaign on CleverTap.

Configure and Create a Webhook on CleverTap

To configure a webhook campaign on CleverTap:

  1. Navigate to Settings > Channels > Webhooks on the CleverTap dashboard.
  2. Click +Add Webhook
  3. Enter the webhook name.
  4. Select the appropriate HTTPS method (POST in this case) and paste the saved URL (from the previous step in the Destination URL.

📘

Webhook Setup

Refer to Webhooks Setup to learn more about the setup process in detail.

  1. Click Create.
  2. Define the structure of the message payload you wish to post on Slack while setting up the What section in the webhook editor.

Consider a sample custom body payload as shown in the following image:

25182518

📘

Note

In the Custom Body payload, ensure that your message Key is in lowercase. For example: "text" not "Text".

  1. After defining the payload structure, test the alert:
    a. Click Preview & Test
    b. Select a sample test profile.
    c. Click Apply and click Send Test.
15641564

The Slack alert for the above-defined payload appears as follows on the selected Slack channel.

19461946

To learn more about the overall campaign creation process for Webhooks, refer to create webhook message document.