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
Log in to Slack using your account (https://slack.com/signin). Ensure that you have already created your Workspace.
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
Click Create New App as shown in the image below.
Specify your app name and workspace.
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:
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 LumaTo get the Redirect URL, you must log in to your Luma environment. Perform the following steps:
Log in to Luma and navigate to Bot Configuration> Channels
Click Slack from the Configure Channel list on the right panel as shown below:
The following window appears.
Copy the Redirect URL as shown in the above image.
Paste the Redirect Request URL in the Auth & Permissions page in the Salck API as shown below.
Click Add.
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.
Navigate to the Slack API Settings and click App Home.
Slack will create a Bot automatically for your App with the same name.
Under How your App Displays, Click Edit to update bot details.
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.
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.
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:
Navigate to the Slack API Settings and click Event Subscriptions.
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).
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.
Once the Request URL is verified, Click Subscribe to bot events in the Event Subscriptions page in the Slack API.
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
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:
Navigate to the Slack API Settings and click Interactive Components.
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.
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.)
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:
Navigate to the Slack API Settings and click Basic Information.
In the App Credentials section, do the following:
Copy the Client ID
Copy the Client Secret
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:
In the Configure Slack window in Luma, paste the Client ID, Client Secret, and Signing Secret.
Click Save.
You will be redirected to the following page.
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:
On Settings screen, navigate to Tenant Information tab.
In Mapped Channel ID section,
Click Add Channel,
In Channel field, select “Slack”.
Select “ChannelSourcedata” in User Attributes, for Luma to auto identity the users from Slack’s source data.
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