Search code examples
slackslack-api

Relationship between Bot tokens and workspace


I have created my first slack app and I'm about to try and publish it to the app directory.

In my app, when I try to perform API calls like api/views.publish or /api/views.open, I use the Bot User OAuth Token found in OAuth & Permission in my app settings page.

The part that I'm confused by is the token I have universal for all workspaces that download the app, or will it be unique per workspace that installs it?

If it is not universal, then how would I go about to programmatically retrieve the bot token for each workspace?


Solution

  • You'll need to make sure your app handles Oauth. Everytime a different workspace installs your app they'll need to be taken through an oauth flow where your app will be granted tokens associated with that specific workspace. https://api.slack.com/authentication/oauth-v2