Slack.PNG

Within our Cognigy.AI platform you're able to connect your Cognigy resources to your Slack Bot by using our Slack Endpoint integration.

Inject & Notify

You can use the Inject and Notify functionality with this type of Endpoint. For further details see the Inject & Notify Documentation page.

With the implementation of a Slack Endpoint you can easily connect your Slack Bot with Cognigy.AI.

This How to covers the necessary steps for creating and connecting a Slack Endpoint. If you want to get information about assigning a Flow to the Endpoint and setting up the Data Management see Endpoints.

Two Step Preparation Process

1 Configure Your Slack App for the usage of the Cognigy Endpoint on Slack API
2 Creation and Configuration of a Slack Endpoint within Cognigy.AI

1 Configure Your Slack App

🔗 On Slack API

Requirements
✔ Slack Login
✔ A Slack Workspace

1.1 Create a Slack App

Create a Slack App for your Slack Workspace (see figure 1.1).

25e7227-createSlackApp.png
Figure 1.1: Create a Slack App

1.2 Add Permission Scopes

Your bot needs permission to post messages in a chat. For that go to the OAuth & Permissions page of your Slack App.Scroll down to the Scopes section and select the permission chat:write, im:write and incoming:webhook (see figure 1.3).

4479eca-scopes.png
Figure 1.3: Adding Permission Scopes

1.4 Get the Verification Token

To successfully connect your Slack App with the Cognigy.AI Endpoint you'll need the Verification Token of your Slack App. Go to the Basic Information page of your Slack App and scroll to the App Credentials section. There you have to get the Verification Token (see figure 1.4) and save it (e.g. in a txt-file).

d6641d9-Slack_App_Credentials.png
Figure 1.4: Slack App Credentials

1.5 Get the OAuth Access Token

Go to the OAuth & Permissions page of your Slack App and scroll to the Tokens for Your Workspace section (see figure 1.5). Copy the Bot User OAuth Access Token (starts with the characters xoxb-) and save it. You can also use the OAuth Access Token, but then the bot will only have the same permissions as your user account. You can find more information about the OAuth tokens here.

Missing Token

In case you can't find the token: be sure that your Slack app is installed to your workspace. After installing it'll generate the two tokens.

7033880-Slack_OAuth_Access_Token.png
Figure 1.5: OAuth Access Token

1.6 Enable Interactive Responses for Quick Reply Buttons

In order to make Quick Reply messages work, the following documentation must be followed to enable the functionality: https://api.slack.com/interactivity/handling#setup 

Within this article it talks about the Request URL, which is the Slack Endpoint URL of the Cognigy.AI Virtual Agent

 

Now we are able to set up the Slack Endpoint within Cognigy.AI.

2 Creation and Configuration of the Slack Endpoint

🔗 On Cognigy.AI

Requirements
✔ OAuth Access Token
✔ Verify Token

2.1 Create a Slack Endpoint

First you have to create a Endpoint of the type Slack (see figure 2.1).

Slack1.PNGFigure 2.1: Endpoint Creation Menu

2.2 Configure the Slack Endpoint

Expand the Slack Setup panel (see figure 2.2) and paste the saved tokens (step s1.4 and 1.5) into the corresponding fields.

SLACKSETTINGS.PNGFigure 2.2: Enpoint Configuration - Slack Setup

2.3 Get the Endpoint URL

Move to the top of the Endpoint Configuration page and copy the Endpoint URL which is displayed above the General Settings (see figure 2.3).

SLACK2.PNGFigure 2.3: Endpoint configuration page of a Slack Endpoint

Final Step: Connect Your Slack App to the Endpoint

🔗 On Slack API

Requirements
✔ Endpoint URL

Go to the settings page of your Slack App and open the Event Subscription page. Paste the copied Endpoint URL (step 2.3) into the the Request URL field (see figure 2.4) A "verified" message should indicate that the entered URL is valid and that the Endpoint can be reached.

10e6487-enableEvents.png
Figure 2.4: Slack App Event Subscription page

Now you just need to subscribe to the Bot Events which will trigger the bot. You can subscribe to the app_mention and message.im events.

You should be all set up to use the Slack Endpoint you've created with a Flow of your choice.


Comments

0 comments

Article is closed for comments.

Was this article helpful?
0 out of 0 found this helpful