Templates · Messaging

Slack Web API collection template

Post messages, read channels and list users with the Slack Web API.

What's inside

Send a message to a channel, reply in a thread, read channel history and list users with a Slack bot token. Handy for testing a bot or a release notification before wiring it into code.

6 requests in 2 folders · Base URL https://slack.com/api · Bearer token

Set it up

  1. Open Slack Web API in Requestarium (or in the app: Import, Start from a template) and import it. You get the collection and a "Slack Web API" environment.
  2. Create a Slack app at api.slack.com/apps, add the chat:write, channels:read, channels:history and users:read bot scopes, install it and copy the Bot User OAuth Token (xoxb-…). Invite the bot to the channel.
  3. Fill in the environment, pick it in the environment menu and send the first request.

Environment variables

VariableWhat it is
slackBotTokensecretBot User OAuth Token, xoxb-…
channelIdChannel id, like C0123456789 (channel details, About).
messageTsFilled by "Post a message"; the thread to reply in.

Requests

Messages

  • POST
    Check the token /auth.test

    Which workspace and bot the token belongs to.

  • POST
    Post a message /chat.postMessage

    Posts to the channel and saves the message ts.

  • POST
    Reply in a thread /chat.postMessage

    Replies to the message above.

  • GET
    Read channel history /conversations.history

    The latest messages in the channel.

Channels and users

  • GET
    List channels /conversations.list

    Public channels with their ids.

  • GET
    List users /users.list

    Members of the workspace.