slack-ruby / slack-ruby-client

A Ruby and command-line client for the Slack Web, Real Time Messaging and Event APIs.
MIT License
1.21k stars 216 forks source link

MissingScope Error when trying to retrieve channels #432

Closed carltonsmith closed 2 years ago

carltonsmith commented 2 years ago

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

dblock commented 2 years ago

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.