Slack

A BDK Book containing automation procedures for Slack.

Overview

The Slack BDK Book provides a set of automation procedures designed to interact with the Slack messaging platform. Adding this Book to a Kognitos agent enables it to perform operations such as reading messages, sending messages, and retrieving information about specific channels and users.

Prerequisites

Learning the Slack Book (BDK)

1

In the left navigation bar, click on Books.

2

Add a Book

In the Books page, click on + New Book.

3

Search for the Book

Search for the Book's name. Click on the version tagged with bdk.

You will be prompted to provide the connectivity details if configuration is required.

4

Finalize

Click Add to finish adding your Book.

Connectivity

Connecting to the Slack Book requires an OAuth Token that your application will use to make API calls and receive events.

Obtaining Your OAuth Token

The primary token you'll need is a Bot User OAuth Token. To obtain one:

  1. Create a Slack App: If you haven't already, you'll need to create a Slack App in your workspace.

    • Go to the Slack API site and click "Create New App."

    • Choose to build it "From scratch" or use a manifest.

  2. Add Scopes: Navigate to "OAuth & Permissions" in your app's settings. Under "Bot Token Scopes", add the following permissions (scopes) for this Book:

    • channels:history

    • channels:join

    • channels:read

    • chat:write

    • chat:write.public

    • conversations.connect:read

    • conversations.connect:write

    • files:write

    • groups:read

    • groups:write

    • im:history

    • im:read

    • im:write

    • im:write.topic

    • mpim:history

    • mpim:read

    • mpim:write

    • mpim:write.topic

    • users.profile:read

    • users:read

    • users:read.email

    • users:write

  3. Install to Workspace: Install (or reinstall if you changed scopes) your app to your development workspace. This will generate the Bot User OAuth Token.

  4. Copy Your Token: Once installed, you'll find the xoxb- token on the "OAuth & Permissions" page. Copy this token and add it to Kognitos when learning the Book.

For more detailed steps on app creation and token generation, refer to the official Slack API documentation on authentication.

Procedures

The following procedures are available in the Slack BDK Book:

  1. Read Messages: Reads messages from either a slack user or channel.

  2. Retrieve a Channel: Fetches information about a Slack channel.

  3. Retrieve a User: Fetches information about a specific user in Slack.

  4. Send a Message: Sends a message to a channel or user in Slack.

Automation Examples

retrieve a channel from slack with
  the channel name is "general"
the message is "Hello, this is my first slack message!"
send the message to the channel
read the channel's messages

Last updated

Was this helpful?