Skip to content

Instantly share code, notes, and snippets.

@adsr
Created April 16, 2018 02:03
Show Gist options
  • Save adsr/c91d1d166fcb347009cc4417fd54f4aa to your computer and use it in GitHub Desktop.
Save adsr/c91d1d166fcb347009cc4417fd54f4aa to your computer and use it in GitHub Desktop.
Getting Slack Tokens

It is not straight forward to get a token with Slack. The expectation is that you write an OAuth client to get the token, but it is possible to get it manually. These are the steps I followed:

You should already have an account and a channel set up that you want to send error messages to.

  1. Create a new Slack App - https://api.slack.com/applications/new which will give you a client_id and a client_secret which you need for step two. You will need to enter a redirect URI, which can be any page for this purpose.
  2. Got to https://slack.com/oauth/authorize?client_id=[client_id]&scope=chat:write:bot
  3. Authorise App on the page that is returned.
  4. From the URI copy the code that is returned.
  5. Go to https://slack.com/api/oauth.access?client_id=[client_id]&client_secret=[client_secret]&code=[code]
  6. Your token is in the JSON that is displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment