Python-slack-sdk: Getting not_allowed_token_type error using Bot Oauth token

Created on 24 Dec 2019  路  4Comments  路  Source: slackapi/python-slack-sdk

Description

I am following this tutorial and am getting the following error. I am also printing my BOT Token fetched from the environment variable and it is matching what I see in my Slack console for Bot User OAuth Access Token

slack.errors.SlackApiError: The request to the Slack API failed.
The server responded with: {'ok': False, 'error': 'not_allowed_token_type'}

What type of issue is this? (place an x in one of the [ ])

  • [ ] bug
  • [ ] enhancement (feature request)
  • [X] question
  • [ ] documentation related
  • [ ] testing related
  • [ ] discussion

Requirements (place an x in each of the [ ])

  • [X] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [X] I've read and agree to the Code of Conduct.
  • [X] I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slackclient version:
2.5.0
python version:
3.7.6
OS version(s):

Steps to reproduce:

  1. Setup the files as described in the tutorial
  2. Set environment variable with your bot user Oauth access token
  3. Run app.py file

Expected result:

Bot to receive events and run

Actual result:

Getting the not_allowed_token_type error

Attachments:

Most helpful comment

Hello awesome folks from slack!! With RTM deprecated what is the alternative for the below usecase?

  • With Event a bot solution is forced to go to public
  • The data being fed to the bot is not public for events api to access.
  • Not all usecase in the organization requires distributed apps.
  • There is no way in Web api to push a message to bot and receive response back.

i'm wondering why slack had to deprecate a way which would completely block a way of working with a bot and want everyone to deal with exposing their apis casing security concerns, firewall.

All 4 comments

ohh, if you by accident update your app, you will get the exactly same error

is this resolved ? when can i look for the solution for this problem?

Hey @sujansonly,

RTM isn't supported for the new granular scopes. We recommend using events API instead with the new scope. Checkout our tutorial for an example of it in action.

If you still need to use RTM, you can instead create a classic slack app

Hello awesome folks from slack!! With RTM deprecated what is the alternative for the below usecase?

  • With Event a bot solution is forced to go to public
  • The data being fed to the bot is not public for events api to access.
  • Not all usecase in the organization requires distributed apps.
  • There is no way in Web api to push a message to bot and receive response back.

i'm wondering why slack had to deprecate a way which would completely block a way of working with a bot and want everyone to deal with exposing their apis casing security concerns, firewall.

Was this page helpful?
0 / 5 - 0 ratings