10

I have get access token and when I try to post rtm.start, I am getting below error:

{
    error = "missing_scope";
    needed = client;
    ok = 0;
    provided = "identify,read,post";
}

I have set the scope to read,post,identify in authorize API. I have read the API document over and over again. Only rtm.start mentioned client scope. But in oauth document I didn't find a client scope. So, what's wrong?

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
yong ho
  • 3,892
  • 9
  • 40
  • 81

2 Answers2

10

You have to do it before you get the token.

when you do the initial request to connect the app, include &scope="identify,read,post,client"

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
hailgrail
  • 124
  • 1
  • 2
4

Under App Credentials get your Client ID and Client Secret. Goto:

https://#{team}.slack.com/oauth/authorize?client_id=#{cid}&scope=client

replacing #{team} and #{cid} with your values.

When you approve the authorization you’ll goto that real url that doesn’t resolve. Copy the whole url to your clipboard and paste it into a text file. Extract out just the “code” part.

Now goto:

https://#{team}.slack.com/api/oauth.access?client_id=#{cid}&client_secret=#{cs}&code=#{code}"

And you’ll get back a token like: xoxp-4422442222–3111111111–11111111118–11aeea211e

(from here: https://medium.com/@andrewarrow/how-to-get-slack-api-tokens-with-client-scope-e311856ebe9)

Svyat P.
  • 132
  • 1
  • 4