Traveling Tech Guy
Traveling Tech Guy

Reputation: 27811

Get Slack user name through oAuth API

I'm using th eSlack oAuth API to integrate my app with Slack. Following these instructions I do the following:

  1. Call https://slack.com/oauth/authorize passing my client_id, and the scope "identify,read,post -> I get a code
  2. Call https://slack.com/api/oauth.access with the id, secret, code -> I get an access token
  3. I now want to get the user's handle (name) -> looking at the user.info documentation, I need to provide my token, and the user's ID - which I don't have.

Where/how am I supposed to get the user's ID? What am I missing?

Upvotes: 8

Views: 4502

Answers (1)

osowskit
osowskit

Reputation: 6344

You have access to this information in the auth.test endpoint. It will also return the team id, user id, and user's name.

Upvotes: 11

Related Questions