Search code examples
slackslack-apislack-commands

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


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.


Solution

  • 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.