Configure Slack

Slack is one of the most popular instant messaging and collaboration applications. Luma Virtual Agent supports Slack as a chat channel for the organizations that use Slack for their user communication. The article describes how we can configure Slack to converse with Luma.

Prerequisite: You would need to have Slack workspace for your organization with Administrator privileges. If it is not available, refer to Create a Slack Workspace to create a workspace.

Follow the below steps to configure your bot to communicate with end-users through the Slack messaging app:

Step 1: Create an App

  1. Log in to your Slack Workspace on https://slack.com/signin. If a workspace does not exist already, create a new Workspace.

     

  2. Once you are logged in to your Workspace, click on the below link to create a Slack Application Channel.
    https://api.slack.com/apps?new_app=1

  3. On the ‘Create a Slack App' screen, add the details for your Slack App

    1. App Name and select your Workspace.

    2. Click on the Create App button.

      Note: In case, you do not land on the Create a Slack App page directly. Click on the Create New App button on the Slack API homepage.

       

  4. Your Slack App has now been created and you will be redirected to the following screen:

     

  5. Scroll down to App Credentials. This section contains the unique App ID Client ID, Client Secret, and Signing Secret assigned to the App. The information is used to configure Slack as a Chat channel in your Luma VSA Tenant and allows the tenant to access the Slack API.
    Copy App ID, Client ID, Client Secret, and Signing Secret and retain the information in an easily accessible location such as notepad or any text editor tool. The information will be later used to configure and enable Slack in Luma VSA.

Step 2: Configure your Slack App

Once the App is created, the next step is to configure the App and provide the required permission to enable it to interact with your Luma Bot. Below are the configurations required:

  1. Add the endpoint URL in your Slack App. The RequestURL from Luma VSA is added to your Slack App. To add the URL, follow the below steps:

    1. Log in to your Luma VSA tenant on Bot Builder UI.

    2. Navigate to the Channel tab on the Bot Menu → Configurations page.

    3. Click on Slack tile.

    4. You are now redirected to the Configure Channel page. Copy the value in RequestURL/RedirectURL field and retain the same on a notepad or any text editor tool. The URL would be added to your Slack App in the next step.

    5. Now on the Slack API page, navigate to the Event Subscription tab.

    6. Toggle Enable Events button to On.

    7. Add the RequestURL copied in Step 2 → 1(d) to the Request URL field. Slack API will send a request to the endpoint and verify the URL. Only after the verification, Slack will be able to connect to your tenant.

       

  2. Now, scroll down to Subscribe to bot events.
    Here we subscribe to the bot ‘receive events’ such as new messages in the channel. This enables Slack to communicate with Luma VSA. You may subscribe to events based on your organization’s needs. To learn about all the event types, see https://api.slack.com/events. To subscribe to the events, do the following:

    1. Click on Add Bot User Event button

    2. Search and add the below event subscriptions one by one.

      • member_joined_channel

      • member_left_channel

      • message.channels

      • message.groups

      • message.im

      • message.mpim

         

    3. Click Save Changes.

       

  3. The next step is to add OAuth and Permissions.

    1. Navigate to the OAuth & Permissions tab.

    2. Click on Add new Redirect URL. The Redirect URL is required for authentication. The URLs in Luma VSA and Slack must match for successful app configuration.

       

    3. Add the RequestURL copied in Step 2 → 1(d) to the Redirect URLs field and click Add.

    4. Click the Save URLs button

    5. After the URL is added, we add Scope. Your app's capabilities and permissions to interact with Luma VSA are governed by the requested scopes.
      On the Scopes → Bot Token Scope section, click on Add an OAuth Scope and add the following scopes one by one.

      • channels:history

      • channels:read

      • groups:history

      • groups:read

      • im:history

      • mpim:history

         

  4. On the Scopes → UserToken Scope section, click on Add an OAuth Scope and add the following scope:

    • users.profile:read
      Note users.profile:read enables Luma VSA to request user information from Slack to auto authenticate the user.

  5. The next step is to configure Interactive Components, i.e. enable interactions between Slack and Luma VSA with interactive components such as buttons, select list, and more. To do so, follow the below steps:

    1. Navigate to Interactivity & Shortcuts tab.

    2. Toggle the Interactivity button to On.

    3. Add the RequestURL copied in Step 2 → 1(d) to the Request URL field. Slack will send a request with information to this URL when users interact with an interactive component.

    4. Click Save Changes.

  6. Now navigate to the App Home tab and enable the following:

    1. Under Your App’s Presence in Slack section, toggle Always Show My Bot as Online to enabled.

    2. Under the Show Tabs section, toggle the Home tab to enabled.

When OAuth Scope Permissions are updated, reinstalling the App is required for changes to take effect. Click on Reinstall your app, in case Slack presents the following prompt. Luma VSA will request permission to access your Slack Workspace. You will be redirected to the permission request page (similar to Step 3-->point 7 ). Click on the Allow button to accept the access request.

  • **This may not be required when adding the permissions for the first time.

Step 3: Configure Slack in Luma

Now that your Slack application is ready, the next step is to enable Slack Chat Channel and submit credentials in Luma VSA. To do so, follow the below steps:

  1. Log in to your Luma VSA tenant on Bot Builder UI.

  2. Navigate to the Channel tab on the Bot Menu → Configurations page.

  3. Click on Slack tile.

  4. On the Configure Channel page, paste the App ID, Client ID, Client Secret and Signing Secret values (retained in notepad in Step 1 → 5) in their respective fields.

     

  5. Scroll down to User Reconciliation For Channel Authentication section, to specify the user detail that will be used by Luma VSA to reconcile and auto authenticate users connecting through Slack. Since Luma VSA uses email address to authenticate users through Slack, add the Luma fields that may contain the user’s email address.

    1. Select the required user information in User Fields

    2. Click on the Set button.
      You may add one or more fields. During reconciliation or authentication.

  6. Once the details are added, Click on the Configure button to enable the channel.

     

  7. Luma VSA will request permission to access your Slack Workspace. You will be redirected to the below page.

  8. Click on the Allow button to accept the access request. The following page appears with a success message.

  9. Slack is now enabled for your tenant. End-Users can communicate with Luma VSA through Slack as a chat channel.

Slack is now configured for your Tenant and registered users can communicate with Luma VSA through Slack.

On Slack, your bot now appears under Apps in the left panel for all members of your Workspace.

To start interacting with the bot, end users can type a message in the textbox. If the logged-in user is already available in Luma, (with the same email address as in the user’s Slack profile), the user will be auto-authenticated by the system. No manual registration is required.

 

Related pages

© 2019 Serviceaide 1-650-206-8988 http://www.serviceaide.com info@serviceaide.com