Slack Integration
Post incoming WhatsApp or SMS messages to a Slack channel through a Custom Webhook, with an optional WhatsApp Chatbot workflow.
Complete these prerequisites:
- Create a Slack channel and copy its Channel ID.
- Create and install a Slack app in the workspace that contains the channel.
- Configure the Slack app with the required OAuth scopes and copy its OAuth token.
This example connects a WhatsApp channel to Slack.
Create a Slack channel
Create a private Slack channel for the incoming messages.
- In Slack, click + Add Channels in the sidebar, then select Create a new channel.

- Enter a channel name, then click Next.

- Choose Private as the channel type, then click Create.

- Open View channel details and copy the Channel ID.

Create and install a Slack app
Create and install a Slack app in the workspace that contains your Slack channel.
- In Slack, click + Add apps in the sidebar. Select App Directory to open the Slack App Directory.

- In the Slack App Directory, select the workspace that contains your Slack channel from the upper-right corner. Click Build, then select Your apps.

- Click Create an App, then select From scratch. Enter an app name, select the workspace that contains your Slack channel, and click Create App.

- In the Settings sidebar, select Basic Information. Under Display Information, enter a short and long app description, upload an app icon, select a background color, and click Save Changes.

- In the Features sidebar, select OAuth & Permissions. Under Scopes, click Add an OAuth Scope and add these permissions:

- chat:write — Send messages as the app.
- chat:write.customize — Send messages with a customized username and avatar.
- files:write — Upload, edit, and delete files as the app. Use this permission to upload images sent from WhatsApp.
Install the app in your workspace to generate an OAuth token. The token authenticates requests from the Custom Webhook to Slack.
- Under OAuth Tokens for Your Workspace, click Install to Workspace. On the app settings page, select the configured scopes and click Allow.

Slack generates a User OAuth token for your workspace.

Integrate the Slack app with a Custom Webhook
Configure a Custom Webhook with the Slack Channel ID and OAuth token. The webhook sends incoming messages to the Slack channel.
- In the main Integrations pane, select the Custom Webhook card.

- In Custom Webhook Information, enter the following values:
- Alias: Enter a name that identifies the Custom Webhook.
- Method: Select POST.
- URL: Enter
https://slack.com/api/chat.postMessage.

- On the Auth tab, select Bearer Token from the Type dropdown and enter the Slack app OAuth token.

- On the Headers tab, use the predefined values.

- On the Body tab, configure the request data that Slack receives for each incoming message.

| Key | Tab | Value | Description |
|---|---|---|---|
| channel | Text | Your Slack Channel ID | ID of the Slack channel where incoming messages are posted. |
| text | Variable | Post inc | Text of the incoming message. |
| username | Variable | Post incomi | Contact that sent the incoming message. |
| attachments[].title | Text | A blank space | Title for the image attachment. |
| attachments[].image_url | Variable | {{multimedia.url}} | Public URL for the image attachment. |
- In Connections, select a WhatsApp or SMS sender when you want every incoming message from that sender to be posted to Slack.
NOTEIf you want to configure the Chatbot automation to integrate the custom webhook, do not select any connection. The delivery channel and sender will be defined when setting the Chatbot.
In this example, we are not going to select any connection.
- Activate the integration by clicking Start ▶.

Optional: Integrate Chatbot automation with the Custom Webhook
Create a WhatsApp Chatbot that sends support requests to the Custom Webhook and your Slack channel.
- Configure the Chatbot to use the Custom Webhook integration you created.
-
Delivery section: Select WhatsApp as the delivery channel, then select the Sender WhatsApp Business Account. To invoke the chatbot, enter the keyword EliPackageContact.

- Interactions section: Add a Welcome Message (the first message in the chatbot decision tree). In this example, enter “Welcome to Eli Package, how can we help you?” and add two menu options.

- Request a new phone number: Redirect the user to the selected automation.
- Contact Support Team: Ask the user to enter the platform name and their question or issue. Redirect this option to the Custom Webhook by selecting Integration Name - Custom Webhook under Redirect To.
The selected option, platform name, and message are posted to the private Slack channel.
-
Summary section: Review the Chatbot configuration, click Live, then select Create Automation.

Incoming WhatsApp messages and Chatbot support requests are now posted to your Slack channel.
Updated 4 days ago
