Search code examples
slack-apislack

Getting not_authed slack error on web api call though token is passed


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.


Solution

  • 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