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:
- Enable incoming webhooks in your workspace
- Save the Webhook Endpoint URL
- Configure and Setup a Webhook campaign on CleverTap to send Slack alerts
To enable the incoming webhook alerts in Slack:
- Navigate to Apps from your Slack workspace and search for incoming webhooks in the search bar.
- Click Add under the Incoming WebHooks app.
The Slack App Directory page opens.
- Click Add to Slack.
If your Slack workspace is managed by admins, you will need to raise a request for adding incoming webhooks to your Slack workspace.
- 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.
After selecting the channel to post your alerts, Slack generates a webhook URL for that specific channel.
Copy and save that webhook URL in a file, as you will need it while configuring the webhook campaign on CleverTap.
To configure a webhook campaign on CleverTap:
- Navigate to Settings > Channels > Webhooks on the CleverTap dashboard.
- Click +Add Webhook
- Enter the webhook name.
- Select the appropriate HTTPS method (POST in this case) and paste the saved URL (from the previous step in the Destination URL.
Refer to Webhooks Setup to learn more about the setup process in detail.
- Click Create.
- 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:
In the Custom Body payload, ensure that your message Key is in lowercase. For example: "text" not "Text".
- 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.
The Slack alert for the above-defined payload appears as follows on the selected Slack channel.
To learn more about the overall campaign creation process for Webhooks, refer to create webhook message document.
Updated 9 days ago