Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Discover the step-by-step process to integrate Digital Agent into your Slack workspace for a smooth integration experience.

Start using Digital Agent in Slack channel by creating and installing Slack App. Then, add Digital Agent to your Slack Channel.

  1. Creating and installing Slack App
  2. Adding bot user to your Slack channel

Creating and Installing Slack App

Create a Slack App and install it before starting conversations with Digital Agent on Slack channel.

Follow the below steps to create and install Slack App:

Step 1: Creating a new Slack App

Step 2: Configuring the Slack App

Step 3: Installing the Slack App

Step 1: Creating a new Slack App

Use the Slack App dashboard to create a new app and specify app details for creating a bot app for Slack.

To create a new Slack App, perform the following steps:

  1. Open Slack app dashboard at Slack API.
  2. Click Create an App.


    Figure: App created in Slack
  3. Choose From scratch.


    Figure: Select From Scratch
  4. In the prompted dialog box, specify values for the following fields:
    1. App Name: input your App name, for example, Digital Agent.
    2. Development Slack Workspace: input any one of your Slack Workspace, for example, Digital Agent.

      Note

      You can change the App name at any time.

      Figure: Define App Name and Development Slack Workspace

      Note

      Your workspace may require apps to be approved by admins. You will need to request approval to install it to the workspace or sign into a different workspace.

      5. Click Create App.

Step 2: Configuring the Slack App

Use HTTP or Socket mode to connect your app to Slack. Instead of subscribing to events directly over HTTP, use socket mode so that you can get them via a private WebSocket. Make sure that your Slack App in your Slack workspace in the public cloud can contact the message endpoint of the Digital Agent server from the internet in order to receive events directly over HTTP. You can do this by configuring your own network firewall or by using certain proxy servers. For more information, see https://api.slack.com/apis/connections.

Connecting to Slack using Socket mode


One way to connect your app to Slack is through Socket mode.

To connect your app to Slack, perform the following steps:

  1. Open Slack App dashboard at Slack API.
  2. Click the App name that you created.
  3. In the left sidebar, click Features > App Manifest to configure your Slack App.
  4. In the manifest, specify values for the following fields:

    Note

    • You should delete the default manifest, and then fill in the manifest details.
    • This is an example manifest for the current version of Slack. If Slack has new changes and this manifest is out of date, you can refer to https://api.slack.com/reference/manifests#creating_manifests to fill out the manifest.


    1. display_information.name: your app name, for example, Digital Agent.
    2. display_information.description: your app description, for example, Digital Agent.

    3. features.bot_user.display_name: your bot name, for example, Digital Agent.

  5. Click Save Changes.
  6. A notification is prompted asking to generate an app level token.


    Figure: App Manifest


    Figure: App Notification

  7. Click Click here to generate, and you will be prompted with a dialog Generate an app-level token to enable Socket Mode.
  8. Specify values for the following fields:
    1. Token Name: socket-mode


      Figure: App-level token to enable Socket Mode

  9. Click Generate.
  10. A dialog socket-mode will be prompted with the token in the dialog. Copy it for the later use while configuring Slack.
  11. Click Done.

Connecting to Slack using public HTTP endpoint

Connect to Slack using HTTP after Digital Agent server is configured and started.

The event request URL and the interaction request URL must be configured in your Slack App if you are using an HTTP endpoint to receive Slack events.

If the IP address of your Digital Agent server is public, you can use the Chatbot messaging endpoint URL <httpEndpoint.protocol>://<httpEndpoint.hostName>:<httpEndpoint.port><httpEndpoint.basePath> directly. Otherwise, you must configure your own network firewall or use some proxy servers to make sure that your Slack App of your Slack workspace in public cloud can access the messaging endpoint of Digital Agent server from Internet.

Note

 You can find the values for protocol, hostName, port, and basePath in the configuration file DIGITALAGENT_HOME/config/chattools/slack.yaml. Where,

  • <httpEndpoint.protocol>: the default value is https;
  • <httpEndpoint.hostName>: the host name where your Digital Agent chatbot server is installed;
  • <httpEndpoint.port>: the default value is 5001;
  • <httpEndpoint.basePath>: the default value is /api/v1/messaging/webhooks/.

To connect Slack using public HTTP endpoint, perform the following steps:

  1. Open Slack API in your browser.
  2. Click your Slack App.

    Note

    You must log in your Slack workspace before you can see your App in Slack.

  3. Configure your Slack App.
    1. In the left sidebar of Slack App dashboard, click Features > App Manifest to configure your Slack App.
    2. In the manifest, specify values for the following fields:

      Note

      You should delete the default manifest, and then fill in the manifest.

      • display_information.name: your app name, for example, Digital Agent.
      • display_information.description: your app description, for example, Digital Agent.
      • features.bot_user.display_name: your bot name, for example, Digital Agent.
    3. Click Save Changes.
    4. A notification pops-up mentioning that the URL is not verified. Ignore this notification, and configure the request URL after the Digital Agent server is configured and started.

      Figure: Notification - App Manifest

  4. Configure the request URL for events subscriptions for your created Slack App.

    Note

    Configure the request URL for events subscriptions after your Digital Agent server is configured and started.

    1. In the left sidebar of Slack App dashboard, click Features > Event Subscriptions.
    2. In the request URL input field, use the Digital Agent messaging-endpoint URL directly if it is publicly accessible. Otherwise, fill in with your public proxy URL that transmits network payload to Digital Agent web hook URL.


      Figure: Enable events - Event Subscriptions
    3. Click Save Changes.

Step 3: Installing the Slack App

Install the Slack App to your workspace before Digital Agent can start conversation in Slack channel.

To install the Slack App, perform the following steps:

  1. Install the Slack App.
    1. Request to install the App.
      1. In the left sidebar, click Settings > Install App.
      2. Click Request to Install. A dialog box will prompt to add an optional note to the administrator to request an approval. Add an optional note to the administrator and then wait for the administrator of your Workspace to approve. You will receive an email as well as a notice from the Slack bot of your Workspace when the approval is done.


        Figure: Install Approved

        Note

        Refresh the web page after receiving an email or a notice confirming approval of your Workspace. Now, install your app to your Workspace.


    2. Install the App to Workspace.
      1. Open Slack App dashboard at Slack API after getting approval for your Workspace.
      2. Click the App name that you created.
      3. In the left sidebar, click Settings >Install APP.
      4. Click Install to Workspace.
      5. A new page will open.


        Figure: Request permission

      6. Click Allow.
      7. The Slack App is installed.
  2. Get the bot user OAuth token by performing the following steps:
    1. Navigate to Settings > Install App.
    2. Find the Bot User OAuth Token.
    3. Click Copy.

    Save this token. You will need it to configure your Slack in later steps.

  3. Get the signing secret by performing the following steps:
    1. Navigate to Settings > Basic information.
    2. Find the Signing Secret in App Credentials section.
    3. Click show.



      Figure: App Credentials

    4. Copy this signing secret.

Save this signing secret. You will need it to configure your Slack in later steps.

Adding bot user to your Slack channel

You can add the bot user that you created to your Slack channel in two ways: either mention your bot user directly in the message field or click the link Add an app at the beginning of your Slack channel.

To add bot user to your Slack channel, follow either of the two methods mentioned below:

A. Mention your bot user directly in the message field

  1. Select the channel where you want to invite your Slack App.
  2. In the message field, type @ and select the bot name you created, for example, Digital Agent. You can see a message stating not in channel notice behind it.
  3. Send the message to the channel. You will receive a message from Slack bot to help you invite your bot user to this channel. Click Invite Them.


    Figure: Invite to channel

B. Click the link Add an app at the beginning of your channel

  1. Select the channel where you want to invite your Slack App.
  2. Click the dropdown menu icon at the top of your channel.
  3. Select Integrations.


    Figure: Dropdown selection

  4. Click Add an App.


    Figure: Add an app

  5. Search for your app with your app name. Click Add.


    Figure: Add app to channel
  • No labels