tuff
tuff

Reputation: 5163

Slack API missing_scope for bot requests

I am trying to set channel topics with a bot user token, but I'm getting the missing_scope error:

{ 
  ok: false,
  error: 'missing_scope',
  needed: 'channels:write',
  provided: 'identify,bot:basic'
}

It works if I provide the "OAuth Access Token" (instead of "Bot User OAuth Access Token") from https://api.slack.com/apps/:appId/oauth, but this is a poor solution because the message that gets printed in the channel says that the app installer set the channel topic, not the bot user.

But, the docs say that bots can call channels.setTopic with a bot token, and they don't need channels:write:

pic from Slack API docs

What gives? Are there different kinds of bot tokens? Am I doing something wrong? As far as I can tell, I cannot set additional permissions for my bot user.

Upvotes: 7

Views: 18574

Answers (1)

Erik Kalkoken
Erik Kalkoken

Reputation: 32852

It also says on the the same documentation page:

Only user tokens may use this method. Bot user tokens will not work.

And since it does indeed not work as you say I am guessing the mention of the bot token in the above table is a documentation mistake.

If you want to be 100% sure I would advise to ask the Slack team directly.

Upvotes: 6

Related Questions