Connect Slack

This page describes how to connect Slack to Agentspace Enterprise.

After you set up your data source and import data the first time, the data store syncs data from that source at a frequency that you select during setup.

Before you begin

Before setting up your connection:

  1. Set up access control for your data source. For information about setting up access control, see Use data source access control.

  2. To follow the steps in Configure your Slack app, you must have the permissions to install new apps in your workspace, that's included in the Workspace Owner role. Contact your Workspace Primary Owner to be assigned as a Workspace Owner.

  3. Understand that by default, Slack restricts crawling and syncing content from private channels, group messages, and direct messages.

Configure the Slack app

The Slack connector requires an access token to be able to ingest documents from your Slack workspace. To obtain an access token to allow Agentspace Enterprise to ingest documents from your Slack workspace.

For more information, see [Quickstart][slack-quickstart] and [How to quickly get and use a Slack API token][slack-token] in the Slack documentation.

There are two different types of tokens you can use:

  • Bot token
    • Benefits:
      • It's not tied to a specific user.
      • It can have a more secure access to private Slack channels, instant messages (IM), and multi-person instant messages (MPIM). The members involved in those channels and messages can invite the bot.
      • The bot can also be invited to public channels. When configuring the bot token, you can add the channels:join permission for the crawler to automatically attempt to join all public channels.
    • Limitations:
      • When the bot attempts to join public channels, a join message is sent to the channel.
  • User token
    • Benefits:
      • It can access all public channels without the need to join them beforehand.
    • Limitations:
      • It's tied to a specific user.
      • With user token, users can't crawl private channels, IMs, and MPIMs that they're not a part of.

Configure bot token

The following steps show you how to configure a bot token:

  1. Sign in to Slack API Apps.
  2. Click Create new app.
    Button in the Slack App to Create New App
    Create new app in Slack App
  3. Select From scratch. This option lets you configure the app's information, scopes, settings, and features.
    Start creating the app from scratch
    Start creating the app from scratch
  4. Enter a name for your app. The name you select is visible to all Slack users.
  5. Select the workspace for integration. Because you can't change an app's workspace later, ensure that you select the correct workspace.
    Enter a name and select the correct workspace
    Enter a name and select the correct workspace
  6. Click Create app.
  7. In the sidebar, select OAuth & permissions.
    OAuth & Permissions in the Slack app's sidebar
    OAuth & Permissions in the Slack app's sidebar
  8. Under Bot token scopes, add the following required scopes: By default, the bot reads from the #general and #random channels.
    Select the scopes for the bot token
    Select the scopes for the bot token
  9. To enable the bot to crawl the channels, do the following:
    1. For public channels, do one of the following:
      • Invite the bot manually.
      • Grant the channels:join scope to allow the bot to attempt join automatically.
    2. For private channels, invite the bot manually.
  10. On the same page, click Install to WORKSPACE_NAME.
    Install the app in your workspace
    Install the app in your workspace
  11. Follow the on-screen instructions to install the app and after the app is installed, copy and note the bot's OAuth token.
    Copying the bot token after installation
    Copy the bot's OAuth token

Configure a user token

The following steps show you how to configure a bot token:

  1. Sign in to Slack API Apps.
  2. Click Create new app.
    Button in the Slack App to Create New App
    Create new app in Slack App
  3. Select From scratch. This option lets you configure the app's information, scopes, settings, and features.
    Start creating the app from scratch
    Start creating the app from scratch
  4. Enter a name for your app. The name you select is visible to all Slack users.
  5. Select the workspace for integration. Because you can't change an app's workspace later, ensure that you select the correct workspace.
    Enter a name and select the correct workspace
    Enter a name and select the correct workspace
  6. Click Create app.
  7. In the sidebar, select OAuth & permissions.
    OAuth & Permissions in the Slack app's sidebar
    OAuth & Permissions in the Slack app's sidebar
  8. Under User token scopes, add the following required scopes:
    Select the scopes for the user token
    Select the scopes for the user token
  9. On the same page, click Install to WORKSPACE_NAME.
    Install the app in your workspace
    Install the app in your workspace
  10. Follow the on-screen instructions to install the app and after the app is installed, copy and note your user OAuth token.
    Copying the user token after installation
    Copy the user's OAuth token

Create a Slack Cloud connector

Console

To use the Google Cloud console to sync data from Slack to Agentspace Enterprise , follow these steps:

  1. In the Google Cloud console, go to the Agentspace page.

    Agentspace

  2. In the navigation menu, click Data stores.

  3. Click Create data store.

    In the console create a data store
    In the Google Cloud console, create a data store

  4. On the Select a data source page, scroll or search for Slack to connect your third-party source.

  5. Enter your Slack authentication information.

    • Instance ID (Workspace ID):
      1. To obtain your workspace ID, sign in to your Slack workspace using a web browser. Don't use the Slack app. For more information, see [Specify the Slack source for your data store][slack-workspace-id].
      2. In the URL, note the unique workspace ID, which is the string after /client beginning with T.
        get the workspace ID in the URL next to the client segment
        Obtain the instance ID (workspace ID)
    • Auth token: Use the token obtained from the last when you generated the bot token or the user token.
  6. Select which entities to sync and click Continue.

    1. To crawl all channels, retain the default selections.
    2. To crawl specific channels, click Filter and select the channels. The following image shows an example configuration that allows crawling of channels named general and random.
      select the channels that you want to crawl
      Select the channels to crawl
  7. Select a region for your data store.

  8. Enter a name for your data store.

  9. Select a synchronization frequency for your data store.

  10. Click Create. Agentspace Enterprise creates your data store and displays your data stores on the Data stores page.

  11. To check the status of your ingestion, go to the Data stores page and click your data store name to see details about it on its Data page. The Connector state changes from Creating to Running when it starts synchronizing data. When ingestion is complete, the state changes to Active to indicate that the connection to your data source is set up and awaiting the next scheduled synchronization.

    Depending on the size of your data, ingestion can take minutes or hours.

Next steps