SDK Usage #
Authentication Setup #
Create a Slack App and install it to your workspace to get a Bot Token.
1. Create a Slack App
- Go to api.slack.com/apps
- Click Create New App
- Choose From scratch
- Enter an app name and select your workspace
- Click Create App
2. Configure Bot Scopes
Navigate to OAuth & Permissions and add these Bot Token Scopes:
// Add more scopes based on the actions you need to use.
3. Install App to Workspace
- Scroll up to OAuth Tokens for Your Workspace
- Click Install to Workspace
- Review the permissions and click Allow
4. Copy Bot Token
After installation, copy the Bot User OAuth Token:
xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx
// This token starts with xoxb- and is your API key.
Available Scopes
Add scopes based on the actions you need:
chat:write
send messages
chat:write.public
post to any channel
channels:read
list channels
channels:history
read messages
channels:join
join channels
channels:manage
create/manage channels
users:read
view users
users:read.email
view user emails
reactions:write
add reactions
files:read
view files
pins:write
pin messages
bookmarks:write
manage bookmarks
usergroups:read
view user groups
emoji:read
view custom emoji
Invite Bot to Channels
For the bot to interact with private channels, invite it using /invite @YourBotName in the channel.
Public channels work with chat:write.public scope without an invite.