Slack API missing_scope for bot requests

我们两清 提交于 2019-12-23 22:14:28

问题


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:

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.


回答1:


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.



来源:https://stackoverflow.com/questions/55506352/slack-api-missing-scope-for-bot-requests

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!