How to fix missing scope error in Slack (rtm.connect) API?

江枫思渺然 提交于 2020-01-13 16:23:50

问题


When I try to use the rtm.connect method with own token, tester returns me a false response.

URL : https://slack.com/api/rtm.connect?token=xoxp-532016xxxxx-53xxxxxx-536743xxxxxx-9211bedc4bfe9ddfexxxxxxxxxxxxxx&pretty=1

{
    "ok": false,
    "error": "missing_scope",
    "needed": "rtm:stream",
    "provided": "identify,incoming-webhook,channels:history,im:history,channels:read,im:read,team:read,users:read,users:read.email,users.profile:read,chat:write:user,files:write:user"
}

What am I missing in request? Why does this missing_scope error occur? I already followed the Slack documentation.


回答1:


You need to first create user bot. Follow this link and create one.

Then you will get Bot User OAuth Access Token under Install App in left Navigation bar.

Use this Bot User OAuth Access Token for above request.



来源:https://stackoverflow.com/questions/54528038/how-to-fix-missing-scope-error-in-slack-rtm-connect-api

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