Slack App Setup
Create a Slack app with OAuth scopes for messaging, channels, files, and user management.
Setup Steps
Section titled “Setup Steps”-
Create a Slack App
Go to the Slack API Dashboard and click “Create New App”. Select “From scratch” and choose your workspace.
-
Configure OAuth & Permissions
Navigate to “OAuth & Permissions” in your app settings.
-
Add Redirect URL
Add the OAuth redirect URL for Fp Switchboard:
https://api.switchboard.fpdigital.ai/oauth/slack/callback -
Add Bot Token Scopes
Add the following bot token scopes to enable all Fp Switchboard features:
channels:historychannels:readchannels:writechannels:write.inviteschat:writefiles:readfiles:writegroups:historygroups:readgroups:writeim:historyim:readim:writempim:historympim:readmpim:writereactions:readreactions:writeusers:readusers:read.emailteam:readsearch:readpins:readpins:writebookmarks:readbookmarks:writednd:readdnd:writereminders:readreminders:writeusergroups:readusergroups:writeemoji:read -
Get Client Credentials
Go to “Basic Information” and copy the Client ID and Client Secret.
-
Install App to Workspace
Install the app to your workspace to test the integration. This generates the initial tokens.
Environment Variables
Section titled “Environment Variables”npx wrangler secret put SLACK_CLIENT_IDnpx wrangler secret put SLACK_CLIENT_SECRET| Variable | Description |
|---|---|
SLACK_CLIENT_ID | Client ID from Slack App Basic Information |
SLACK_CLIENT_SECRET | Client Secret from Slack App Basic Information |
Redirect URI
Section titled “Redirect URI”https://api.switchboard.fpdigital.ai/oauth/slack/callbackImportant Notes
Section titled “Important Notes”Common Issues
Section titled “Common Issues”- “missing_scope” error: Ensure all bot token scopes listed above are added. Slack requires exact scope names.
- “not_in_channel” error: The bot must be invited to the channel before it can post or read messages.
- DM access: The bot needs
im:readandim:writescopes to read/send direct messages. Users must initiate a DM with the bot first. - Enterprise Grid: Enterprise Grid workspaces may require org-level app approval. Contact your Slack admin.
- Token rotation: Slack bot tokens don’t expire unless the app is uninstalled or tokens are manually rotated.
Testing
Section titled “Testing”- Go to your Switchboard Dashboard
- Navigate to the Slack service page
- Click Connect and authorize the app in your workspace
- Click Test Connection to verify
- Invite the bot to a test channel and try: “List messages in #general”