Slack Integration makes it easy for your AI Assistant to connect with Slack, a popular messaging app.

Once set up, people can chat with your AI Assistant by sending messages on a slack channel on your workspace.

Prerequisites

To setup Slack Integration you will need 2 pieces of information from the Slack API Dashboard:

1

Bot Token

Bot tokens represent a bot associated with an app installed in a workspace. Unlike user tokens, they’re not tied to a user’s identity — they’re only tied to your app.

2

Signing Secret

Slack signs its requests using a secret that’s unique to your app. With the help of signing secrets, your app can more confidently verify whether requests from Slack.

Setting up the Slack integration

1) Create an App

Visit api.slack.com/apps and create your app by clicking the Create an App button

Choose the option From Scratch

2) Customize your App

Customize your App by giving it a Name and choose the workspace that you want to add the app

3) Add OAuth Scopes

Go to OAuth & Permissions page from the left side menu and Add the following scopes to your bot

1

app_mention:read

2

chat:write

4) Install your App to Workspace

5) Add your Bot OAuth Token to Botstacks

After you have installed your App on your Workspace slack will show you the OAuth token for you Bot. Add this Token on Botstacks integrations page

Do not share this token with anyone else. Whoever has access to this token can login to your App and do anything they want

6) Add your Signing Secret to Botstacks

Go to Basic information page from the left side menu and Copy the Signing Secret then paste it on Botstacks integrations page

7) Subscribe to Bot Events

Go to Event Subscriptions page from the left side menu and Enable Events.

Once you have enabled the events, Subscribe to the following bot events:

1

message.im

2

app_mention

8) Add Botstacks Webhook to your Slack App

Copy the Webhook Callback URL from Botstacks integration page and paste it on Request URL field on Slack Event Subscriptions page.

After you save changes on this page, it will ask you to re-install the App. Follow the prompts to re-install the App

9) Invite your App to your channel

Mention your app on the channel you want to chat with it and Slack will show you an option to invite your app to the channel.

Click on Invite Them to invite your app to the channel

Now you can chat with your App (: