Building a bot app for Slack
This article provides step-by-step instructions on how to build a Slack App with bot functions. This App must next be connected to the main MI application to be able to access content in Metric Insights and process queries submitted by your Slack users.
2. Create an App for your workspace
- Specify the App Name
- Select your team for "Development Slack Workspace"
- Click [Create App]
3. Configure Interactive components
- From the Slack App configuration page Settings > Basic Information, go to Features > Interactive Components
- Switch the Interactivity toggle to "On"
- When the Interactivity option is activated, the Request URL field will be displayed
- Enter Request URL (
/slack/message_actionspart of the URL must be exactly as specified
- Request URL is where the Slack server sends requests when Users interact with Slack app components (by clicking on buttons, invoking commands)
- Enter Request URL (
- Save to proceed
4. Add a Bot User
In order to use your Slack App as a bot, first you have to create a Bot User for it.
- Select Bot Users
- Click [Add a Bot User]
- Display name and Default Username will be added automatically (based on the App name you specified earlier)
- Switch the toggle to Always Show My Bot as Online
- Add Bot User and Save Changes
5. Install App to Workspace
To add an App to your Slack Workspace:
- Go to OAuth & Permissions
- Click [Install App to Workspace]
6. Grant permissions
A Slack App's capabilities and permissions are governed by named scopes.
For the Slack App to be able to handle User requests, add permissions from the Conversations group.
- Access OAuth & Permissions
- Select Permission Scopes
- From the dropdown, add the following Permissions:
Access user's public channels (
Access information about user’s public channels (
Modify your public channels (
Send messages as ProdBot (
Access information about user’s private channels (
Post to specific channels in Slack (
Upload and modify files as user (
- is needed by MI Application to send images to Slack directly
View some URLs in messages (
Add link previews to messages (
- Access user's public channels (
- Save Changes
7. Authorize Permissions
To make the changes effective, you need to authorize permissions.
After "Conversation permissions" have been granted, Slack will prompt you to Select the Channel and Authorize permissions.