In an API url, what does "scope" mean?

2

I'm working on a Slack API using vb.net to schedule. In the page of the site there is how to mount the request url of the API methods, but in one of the parameters is highlighted: "Requires scope: channels: read". This is my current code:

     Dim oRequest As System.Net.HttpWebRequest

        oRequest = System.Net.WebRequest.CreateHttp("https://slack.com/api/channels.list?token=" & oAccessToken.access_token & "&exclude_archived=1")
        oRequest.Method = "POST"
        oRequest.UserAgent = "Aplicação"
        Dim httpResponse As HttpWebResponse = oRequest.GetResponse()
        Using streamReader = New StreamReader(httpResponse.GetResponseStream())
            Dim result = streamReader.ReadToEnd()
            Console.WriteLine(result)
        End Using

This returns the following JSON:

{
    "ok": false,
    "error": "missing_scope",
    "needed": "channels:read",
    "provided": "identify,bot"
}

This is one of the pages that contains information about the API: link Using WebRequest how can I fit this "Channels: read" that appears to be missing?

    
asked by anonymous 05.01.2017 / 13:51

1 answer

0

This API requires OAuth authentication.

In OAuth a scope is a resource aggregate. To gain access to these features the user has to confirm that they have access to the corresponding scope.

For example: In the android applications most applications ask you for authorization to access the internet.

The concept is exactly the same in OAuth. In the case of slack you can see the scopes here

You would then have to place an order for

https://slack.com/oauth/authorize?client_id=...&scope=channels:read

See the oauth section of Slack

    
05.01.2017 / 15:08