Bearer logo
Slack API logo

Slack API

API documentation
https://api.slack.com/methods

Developer website
https://api.slack.com/

Incorrect or missing information? Help us

What is the Slack API?

Slack is a well-known instant-communication platform, now part of any startup toolkit. With a powerful API and an impressive marketplace, Slack bots now supercharge the productivity of thousands of teams around the world.

How to use the Slack API?

NodeJSRubyPythonPHP
// npm install @bearer/node
bearer
.integration('slack')
.auth('AUTH_ID') // Check the code example below on how to generate access tokens
.post('/reminders.add', { headers: { Content-Type: "application/json;charset=utf-8"}, body: { text: "Don't forget to bring your :bear:", time: "in 2 seconds"}})
.then(({ data }) => console.log(data))
.catch(e => console.log(e))
NodeJSRubyPythonPHP
// npm install @bearer/node
bearer
.integration('slack')
.auth('AUTH_ID') // Check the code example below on how to generate access tokens
.post('/chat.postMessage', { headers: { Content-Type: "application/json;charset=utf-8"}, body: { text: "How many types of bears are there?", attachments: [{ text: "Correct answer: 8"}], as_user: true}})
.then(({ data }) => console.log(data))
.catch(e => console.log(e))
NodeJSRubyPythonPHP
// npm install @bearer/node
bearer
.integration('slack')
.auth('AUTH_ID') // Check the code example below on how to generate access tokens
.get('/users.profile.get', { headers: { Content-Type: "application/x-www-form-urlencoded"}})
.then(({ data }) => console.log(data))
.catch(e => console.log(e))
NodeJSRubyPythonPHP
// npm install @bearer/node
bearer
.integration('slack')
.auth('AUTH_ID') // Check the code example below on how to generate access tokens
.get('/conversations.list', { headers: { Content-Type: "application/x-www-form-urlencoded"}})
.then(({ data }) => console.log(data))
.catch(e => console.log(e))
HTML/JSReact
<script src="https://cdn.jsdelivr.net/npm/@bearer/js/lib/bearer.production.min.js"></script>
<button class="btn btn-primary" onclick="myConnectButton()">
Connect to Slack
</button>
<script>
const bearerClient = bearer('YOUR_BEARER_PUB_KEY')
function myConnectButton() {
bearerClient
.connect(
'slack'
)
.then(({ authId }) => {
// Use this authId like bearer.auth(authId).get(..
console.log('AUTH_ID for this user', authId)
})
}
</script>

Start using the Slack API

Bearer provides a universal API client to call any Slack endpoints. It takes care of API authentication, credentials management, and monitoring out-of-the-box.

Available in Node.js, Ruby, Python, and PHP

Sign up with Email

How to get a Slack API Key?

  1. Sign in to your Slack Developer account
  2. In "Your Apps", click on "Create New App"
  3. Fill the form with your application details (name, workspace).
  4. Open the OAuth & Permissions section to configure the OAuth
  5. Register the following redirect URLs https://int.bearer.sh/v2/auth/callback
  6. Finally, select the scopes you want to use.
  7. That's it!

Slack API Rate Limits

Slack has put several limits on its API, with a tiers system based on the impact of the request to the Slack infrastructure. The most common methods have a 20 requests per minute limit (per user per workspace). Have a look into Slack documentation if you have particular needs.

Retry-AfterE.g. 30
A number of seconds until you can retry the request.

Start integrating the Slack API for free!

Universal API client

Query the Slack API and hundreds more APIs using a single API client.

Identity Management

From API credentials to OAuth dance, token and refresh token, Bearer manages it all.

Real-time Monitoring

Get a complete overview of your API usage with metrics and in-depth logs, find errors anddebug in a snap.

Bearer - Integrations built in minutes, Monitored in real-time

Company

Docs & Help

Legal

Bearer is on TwitterBearer is on GitHubBearer is on FacebookBearer is on LinkedIn
© Copyright Bearer 2019
Bearer uses cookies to make its website easier to use. Learn more about cookies.