8

I have successfully added an application in slack api with the permission scope set administer the teams:

I have generated the token from Legacy token generator And I am making a api call with the following information from postman.

endpoint: https://slack.com/api/users.list

method:GET

Headers:

key=token

value=token generated

Its returning me the following Response

{
  "ok": false,
  "error": "not_authed"
}

Trying the same things with curl is working but with POST method and does not works on GET method

curl -X POST https://slack.com/api/users.list --data "token=codehere"

Where exactly am I going wrong.

Tara Prasad Gurung
  • 3,422
  • 6
  • 38
  • 76

1 Answers1

5

It works with GET too, but you have to pass the properties as URL parameter, not in the header.

Here is an example for the syntax:

https://slack.com/api/users.list?token=YOURTOKEN 
Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
  • `{ "ok": false, "error": "missing_scope", "needed": "users:read", "provided": "admin,identify" }` I get this error when I try to make a call directly as you stated. – Tara Prasad Gurung Apr 23 '17 at 09:39
  • Most Slack API methods require your token to have certain scopes attached to it. More details [here](https://api.slack.com/docs/oauth-scopes) – Wilhelm Klopp Apr 23 '17 at 10:21