Configure Slack

This article describes the process to configure Slack as a chat channel to converse with Luma. Slack is a collaboration and instant messaging application for teams. To configure Slack with Luma, you must first have an existing Slack workspace and your account credentials.

You can configure your bot to communicate with end users through the Slack messaging app. To do so, you must perform these steps:

Create your app

  1. Log in to Slack using your account (https://slack.com/signin). Ensure that you have already created your Workspace.

  2. Before you start to configure, you must create a Slack app. To create a slack application channel, use this link https://api.slack.com/apps?new_app=1

  3. Click Create New App as shown in the image below.

     

  4. Specify your app name and workspace.

     

  5. Click Create App. Your app will be created and you will be redirected to the following page.

Add Redirect URL

Now, you need to add a redirect URL. The Redirect URL is required for authentication. If both the URLs match, the app configuration will be successful.

To do so:

  1. Click OAuth & Permissions on the Settings menu and then click Add New Redirect URL.

    Before adding the Redirect URL, you must copy the URL from Luma as explained below.

    Copy URL from Luma

    To get the Redirect URL, you must log in to your Luma environment. Perform the following steps:

    1. Log in to Luma and navigate to Bot Configuration> Channels

    2. Click Slack from the Configure Channel list on the right panel as shown below:

      The following window appears.

    3. Copy the Redirect URL as shown in the above image.

  2. Paste the Redirect Request URL in the Auth & Permissions page in the Salck API as shown below.

  3. Click Add.

  4. Click Save URLs.

Add Scopes

Your app's capabilities and permissions to interact with Luma are governed by the requested scopes. Below scopes should be added to the tab.

Under Scopes--> Bot Token Scopes, click on Add an OAuth Scope to add below scopes:

  • chat:write

  • commands

Under Scopes-->User Token Scopes, click Add on OAuth Scope to add below scope to the app:

  • users.profile:read

Bot user

You need to add a bot user by assigning a name for your bot to interact with users. In Slack, a bot is controlled programmatically via a bot user token that can access one or more of Slack’s APIs.

  1. Navigate to the Slack API Settings and click App Home.

  2. Slack will create a Bot automatically for your App with the same name.

     

  3. Under How your App Displays, Click Edit to update bot details.

     

  4. You may update the following details and Click Save.

    • Display Name (Bot Name): Name of the bot while interacting with users

    • Default Username: The string that is used when the bot is mentioned in a message. This username may be modified slightly from the default when it is installed to a workspace where that username is already reserved. 

       

  5. Click the toggle button on Always Show My Bot as Online to enable the feature. This allows your bot to always appear to be online.

  6. On Show Tabs section, click the toggle button to enable Home tab for your App.

     

Subscribe to events

When you subscribe to events, it allows your bot to reply to the posted messages, changes to channels, and other activities that happen in Slack. When these events happen, a data payload will be sent to your bot, and it can use that data to form a useful response. By subscribing to bot events, your app will be notified of user activities at the URL you specify.

To subscribe to bot events, do the following:

  1. Navigate to the Slack API Settings and click Event Subscriptions.

  2. Click the toggle button to enable events. If you disable the option, your app will no longer be notified of events in Slack (for example, when a user adds a reaction or creates a file).

  3. Specify the Request URL by copying it from the Slack Channel Configuration page in Luma as shown below. (See the above section Copy URL from Luma.)

    This URL is required to be verified in the Event Subscriptions page in the Slack API.

  4. Once the Request URL is verified, Click Subscribe to bot events in the Event Subscriptions page in the Slack API.

  5. Click Add Bot User Event to add individual event subscriptions one by one. Below are the bot events which you can add from the list of events. It depends on your organization which events they want to subscribe to. To learn about the all the event types, see https://api.slack.com/events.

    • member_joined_channel

    • member_left_channel

    • message.channels

    • message.groups

    • message.im

    • message.mpim

  6. Click Save Changes.

Configure interactive components

Interactive components allow you to publish messages with inline buttons, dropdown lists, and more.

To configure interactive components, do the following:

  1. Navigate to the Slack API Settings and click Interactive Components.

  2. Click the toggle button to enable interactive components. If you disable this feature, any interactive messages your app sends will show error messages to your users, including messages that you have already sent.

  3. Specify the Request URL by copying it from the Slack Channel Configuration page in Luma as shown below. (See the above section Copy URL from Luma.)

  4. Click Save Changes in the Interactive Components page in the Slack API.

 

Gather credentials to configure Slack

Now, you must get the app credentials to complete the configuration. A registered app is assigned a unique Client ID, Client Secret, and Signing Secret, which is used in the OAuth flow. This allows your app to access the Slack API.

To fetch the details, do the following:

  1. Navigate to the Slack API Settings and click Basic Information.

  2. In the App Credentials section, do the following:

    1. Copy the Client ID

    2. Copy the Client Secret

    3. Copy the Signing Secret

      These credentials are required to be submitted in the Configure Slack window in Luma.

Submit credentials

To submit credentials in Luma, do the following:

  1. In the Configure Slack window in Luma, paste the Client ID, Client Secret, and Signing Secret.

  2. Click Save.

  3. You will be redirected to the following page.

  4. Click Allow. The following page appears with a success message as follows.

    Now, your bot is enabled to communicate with users in Slack.

Enable Auto authentication in Slack

You can enable auto-authentication for slack users with Luma, so they do not have to go through manual registration process.  

To enable auto authentication, do the following in Luma:

  1. On Settings screen, navigate to Tenant Information tab.

  2. In Mapped Channel ID section,

    1. Click Add Channel,

    2. In Channel field, select “Slack”.

    3. Select “ChannelSourcedata” in User Attributes, for Luma to auto identity the users from Slack’s source data.

  3. Click Save.

Slack is now configured for your Tenant and registered user’s can communicate with Luma through slack.

Communicate using Slack

After the configuration is successful, your app will appear in the left panel in your Workspace as shown below.

To start interacting with the bot, type your message in the textbox.

 

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