Building an App for Slack
This article provides step-by-step instructions on how to build a Slack App. The algorithm described here applies for:
-
Bursting to a Slack channel without using the MI Slackbot:
- Follow the steps below, except the Step 2. Configure Interactive Components
- Connect the Slack App to MI
- Burst to a Slack channel
- MI Slackbot configuration:
1. Access Slack API Page
- Go to https://api.slack.com/apps?new_classic_app=1
- Specify the App Name
- Select your team for "Development Slack Workspace"
- [Create App]
2. Configure Interactive Components
If you are creating a Slack App for bursting without using the MI Slackbot, skip this step and proceed to Add a Bot User.
Access Features > Interactivity & Shortcuts
- Switch the Interactivity toggle to "On"
- When the Interactivity option is activated, the Request URL field will be displayed
- Enter Request URL (
<slackbot server>/slack/message_actions
) - The
/slack/message_actions
part 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 Changes]
3. Add a Bot User
In order to use your Slack App for bursting, you have to create a Bot User for it.
Access Features > App Home
- Click [Add Legacy Bot User]
- Enter Display Name (Bot Name) and Default username
- [Add]
4. 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 Features > OAuth & Permissions
- [Add an OAuth Scope]
- From the dropdown, add the following Permissions:
-
Access user's public channels (
channels:history
) -
Access information about user’s public channels (
channels:read
) -
Modify your public channels (
channels:write
) -
Send messages as ProdBot (
chat:write:bot
) -
Direct messaging and mentioning the Slack App (
bot
) -
View some URLs in messages (
links:read
) -
Add link previews to messages (
links:write
) -
Upload and modify files as user (
files:write:user
):- Is needed by MI Application to send images to Slack directly
-
Access information about user’s private channels (
groups:read
)
-
Access user's public channels (
Navigate to the top of OAuth & Permissions page to proceed with connecting the app to your workspace.
5. Install App to Workspace
- [Install to Workspace]
- [Allow]
- Once the app is installed to your workspace, User OAuth Token and Bot OAuth Token are displayed at the top of the page