Can I figure out who installed a Slack App?

Viewed 1275

I'd like to be able to send a direct message to a user when they install the app, but I can't seem to find a way to tell who that is. Looking at Slack's OAuth documentation, this information simply doesn't seem to be included, only the name of the team and its ID. Any ideas on how to get the individual user?

Here's the relevant documentation: https://api.slack.com/docs/oauth.

Thanks!

2 Answers

When you exchange your temporary code to access token using oauth.v2.access API call, there is authed_user field in the response json. This field contains user id of the user who installed the app. Using this user id you can open direct messages channel to the user and send messages in there.

Related