Create a Slack Connector Bot

In order for your Slack source to retrieve your workspace and channel data, you must create a Slack bot and install it in your workspace, and then add the bot to the channels that you want to index.

Your Slack source authorizes the Coveo organization to access your workspace items using your Slack bot’s OAuth 2.0 access token.

Note

Org-wide installation of a Slack bot is not supported by the Slack source. If you want to index the content of multiple Slack workspaces, you must create a dedicated Slack source and Slack bot per workspace.

Create and Install a Slack Bot

A Slack bot is essentially an app that contains bot token scopes, which give your Slack source permission to access your workspace data.

You can create the Slack bot using a preconfigured manifest file, which includes the required bot token scopes, or manually by adding each scope separately.

Use the Manifest File

  1. Access the app management page on the Slack API website.

  2. Click Create an App.

  3. Click From an app manifest.

  4. Select the workspace in which to install the app.

  5. Click Next.

  6. Replace the default YAML manifest with the following:

    display_information:
      name: Coveo Slack Connector
    features:
      bot_user:
        display_name: Coveo Slack Connector
        always_online: false
    oauth_config:
      scopes:
        bot:
          - channels:history
          - channels:read
          - files:read
          - groups:history
          - groups:read
          - links:read
          - team:read
          - users.profile:read
          - users:read.email
          - users:read
          - usergroups:read
    settings:
      org_deploy_enabled: false
      socket_mode_enabled: false
      token_rotation_enabled: false
    Note

    The app name in the manifest is set to Coveo Slack Connector by default. You can modify the name as required.

  7. Click Next, and then click Create.

  8. Install the app on your workspace.

    Note

    Once you install the app, the Bot User OAuth Token appears. You’ll need the access token when you create your Slack source.

    You can either copy the access token to a secure location where you can access it when creating your source, or you can access the token later from your app’s OAuth & Permissions management page.

  9. Add the app to each channel that you want to index.

Create the App Manually

  1. Access the app management page on the Slack API website.

  2. Click Create an App.

  3. Click From scratch.

  4. Enter a descriptive App Name.

  5. Select the workspace in which to install the app.

  6. Click Create App.

  7. Once you create the app, add the following Bot Token Scopes to your app:

    • channels:read

    • channels:history

    • files:read

    • groups:history

    • groups:read

    • links:read

    • team:read

    • usergroups:read

    • users:read

    • users.profile:read

    • users:read.email

  8. Install the app on your workspace.

    Note

    Once you install the app, the Bot User OAuth Token appears. You’ll need the access token when you create your Slack source.

    You can either copy the access token to a secure location where you can access it when creating your source, or you can access the token later from your app’s OAuth & Permissions management page.

  9. Add the app to each channel that you want to index.

Add the Slack Bot To Your Channels

You can add your Slack bot to any number of public or private channels in your workspace. Your Slack source indexes the message content only for the channels to which the bot is added based on your source configuration.

To index the content of private channels, your Slack bot must include the groups:history and groups:read bot token scopes, and the Private channels option must be enabled in your Slack source.

As new channels are created in your workspace, add the Slack bot to the channels you want to index. You can use the channel_created event in Slack to get notified of new channels.

Tip

To verify the channels to which your Slack bot is currently added:

  1. Access your Slack app management page.

  2. Select your workspace.

  3. Select the app that’s associated with your bot from the list.

  4. Review the channels listed in the Bot User section.

Use one of the following two methods to add a Slack bot to a channel:

From a Channel

Use this method to add the Slack bot to a newly created channel, or to add the bot to a small number of channels.

  1. In your Slack desktop application, click the channel that you want to index.

  2. In the message field, enter /add, and then click Add apps to this channel.

  3. Click Add corresponding to the app that’s associated with your Slack bot.

  4. Repeat the steps above to add the Slack bot to another channel.

From the Apps Sidebar Menu

Use this method to add the Slack bot to numerous channels.

  1. In your Slack desktop application, if the app that’s associated with your Slack bot doesn’t appear under Apps in the left sidebar:

    1. Under Apps, click Add Apps.

    2. Click your app. Your app now appears under Apps.

  2. Under Apps, right-click the app, and then click View app details.

  3. Click Add this app to a channel.

  4. Select the channel from the list.

  5. Click Add.

  6. Repeat steps 4 and 5 for each subsequent channel.

What's next for me?