slack-ruby/slack-ruby-client

MissingScope Error when trying to retrieve channels

carltonsmith opened this issue · 1 comments

What I did in rails console

  client = Slack::Web::Client.new
  => #<Slack::Web::Client:0x00000001153d76b8
  client.auth_test
  => {"ok"=>true, "url"=>"...
  channels = client.conversations_list.channels
  => ...ruby/gems/3.1.0/gems/slack-ruby-client-1.0.0/lib/slack/web/faraday/response/raise_error.rb:21:in `on_complete': missing_scope (Slack::Web::Api::Errors::MissingScope)

The readme indicates that this should return a list of channels and not this error instead

This means your token is missing the permission scope. See required scopes in https://api.slack.com/methods/conversations.list. This is something you specify when obtaining the auth token.