This documentation supports the 20.08 version of BMC Helix Chatbot.
To view the documentation for the previous version, select 20.02 from the Product version menu.

Enabling Slack in a chatbot application

You can use Slack as one of the communication channels for chatbot applications so that Slack users can connect to BMC Helix Chatbot. The configuration for BMC Helix Chatbot to work with Slack is applied to all chatbots in your tenancy. If you have multiple chatbots, you must repeat the procedure for each chatbot. 

The following image describes the process of configuring Slack to work with your BMC Helix Chatbot application:

Note

If you have configured Slack earlier to work with BMC Helix Chatbot, you must migrate this classic Slack application to the new Slack application. If you do not want to create a Slack application, complete the steps in To migrate the classic Slack application.


Task 1: To create an application in Slack and set the application scope

  1. Create a Slack workspace and an application in Slack.

    1. Create a Slack workspace Open link .
    2. (Optional) Invite new members to your workspace Open link .
    3. Create a Slack App Open link to create an application in Slack, and complete the steps in the wizard.
    4. Configure a bot user for your Slack application as specified in Creating a bot user Open link .
  2. Set the OAuth permissions.

    1. Navigate to the application that you created in Slack.
    2. Select OAuth & Permissions.
    3. Select Scopes > Bot Token Scopes and select the following OAuth scopes:
      • channels:history
      • chat:write
      • files:read
      • files:write
      • users:read
      • im:history
    • The following image shows the Bot Token Scopes that you must select:

  3. On the OAuth & Permissions page, in the OAuth Tokens & Redirect URL section, click Install App to Workspace

  4. Copy the Slack application credentials. 

    1. On the OAuth & Permissions page, in the Tokens for Your Workspace section, copy the Bot User OAuth Access Token.
    2. In the left pane, under the Settings menu , select Basic Information.
    3. Copy the following credentials:
      • App ID
      • Verification token
      The following image shows the Slack application credentials that you must copy:

Task 2: To configure a chatbot application to work with Slack

  1. Log in to BMC Helix Innovation Studio.
  2. On the Workspace tab, click the application in which you want to configure a chatbot to work with Slack. 
  3. Click the Chatbots tab, and click the chatbot that you want to configure to work with Slack. 

  4. Click the Channels tab and select New Slack

  5. In the Slack Settings section, enter values for the following fields, and click Save.

    FieldDescription
    DescriptionEnter the description that provides details about the setting.
    Slack Application ID

    Enter the App ID that you copied earlier.

    Slack Bot User Auth Access Token

    Enter the Bot User OAuth Access Token that you copied earlier.

    Slack Verification Token

    Enter the Verification Token that you copied earlier.

    Webhook URL(Information only) This field is populated automatically.
    Webhook URL is the Request URL that you provide when you configure your Slack application.
  6. Copy the Webhook URL for future reference. 

Task 3: Subscribe to Slack event and configure interactive components

You must subscribe to events in Slack to receive notifications for these events, such as when the end user posts a message. You also configure the interactive components in Slack such as buttons, menus, and date pickers. 

  1. Subscribe to Slack events. 

    1. Navigate to the application that you created in Slack.
    2. In the left pane, under the Features menu, select Event Subscriptions.
    3. In the Enable Events section, select the Enable Events toggle button.
    4. In Request URL, enter the webhook URL that you copied earlier.
    5. Click Subscribe to bot events and add message.im.
    6. In Subscribe to events on behalf of users, ensure that you have not added any Workspace event.

    The following image shows the bot event that you must subscribe:



  2. Configure the interactive components. 

    1. Navigate to the application that you created in Slack.
    2. In the left pane, under the Features menu , select Interactive Components.
    3. In Interactivity, select the Interactivity toggle button.
    4. In Request URL, specify the webhook URL that you copied earlier, and save the changes.

    You have now configured Slack to work with BMC Helix Chatbot.

To migrate the classic Slack application

  1. Navigate to the application that you created in Slack.
  2. In the left pane, under the Tools menu, select Update to Granular Scopes.
  3. Set Bot Token Scopes. 

    1. Delete all the existing Bot Token Scopes that you has set earlier.
    2. Select the following Bot Token Scopes: 
      • channels:history
      • chat:write
      • files:read
      • im:history
    3. Delete all the User Token Scopes that you selected earlier.
    4. Select Yes, migrate my app, as shown in the following example:

  4. Subscribe to bot events. 

    1. In the left pane, under the Features menu, select Event Subscriptions.
    2. Delete all the Events that you subscribed to earlier.
    3. Click Subscribe to bot events and add the message.im event.

    For more information about migrating the classic Slack application, see  Migration guide for classic Slack apps Open link

Related topic

Configuring a chatbot to work with a communication channel

Was this page helpful? Yes No Submitting... Thank you

Comments

  1. Aaditi Lakade

    Hello, Thank you for your suggestion. However, currently, there are no plans to create a video for this topic.

    Aaditi

    Apr 15, 2020 04:55