Slack App Setup1
Discover the step-by-step process to integrate Digital Agent into your Slack workspace for a smooth integration experience.
Start using Digital Agent in Slack channel by creating and installing Slack App. Then, add Digital Agent to your Slack Channel.
- Creating and installing Slack App
- Adding bot user to your Slack channel
Creating and Installing Slack App
Create a Slack App and install it before starting conversations with Digital Agent on Slack channel.
Follow the below steps to create and install Slack App:
Step 1: Creating a new Slack App
Step 2: Configuring the Slack App
Step 3: Installing the Slack App
Step 1: Creating a new Slack App
Use the Slack App dashboard to create a new app and specify app details for creating a bot app for Slack.
To create a new Slack App, perform the following steps:
- Open Slack app dashboard at Slack API.
- Click Create an App.
Figure: App created in Slack - Choose From scratch.
Figure: Select From Scratch - In the prompted dialog box, specify values for the following fields:
- App Name: input your App name, for example, Digital Agent.
Development Slack Workspace: input any one of your Slack Workspace, for example, Digital Agent.
Note
You can change the App name at any time.
Figure: Define App Name and Development Slack Workspace
Note
Your workspace may require apps to be approved by admins. You will need to request approval to install it to the workspace or sign into a different workspace.
5. Click Create App.
Step 2: Configuring the Slack App
Use HTTP or Socket mode to connect your app to Slack. Instead of subscribing to events directly over HTTP, use socket mode so that you can get them via a private WebSocket. Make sure that your Slack App in your Slack workspace in the public cloud can contact the message endpoint of the Digital Agent server from the internet in order to receive events directly over HTTP. You can do this by configuring your own network firewall or by using certain proxy servers. For more information, see https://api.slack.com/apis/connections.
Connecting to Slack using Socket mode
One way to connect your app to Slack is through Socket mode.
To connect your app to Slack, perform the following steps:
- Open Slack App dashboard at Slack API.
- Click the App name that you created.
- In the left sidebar, click Features > App Manifest to configure your Slack App.
In the manifest, specify values for the following fields:
Note
- You should delete the default manifest, and then fill in the manifest details.
- This is an example manifest for the current version of Slack. If Slack has new changes and this manifest is out of date, you can refer to https://api.slack.com/reference/manifests#creating_manifests to fill out the manifest.
1. display_information.name: your app name, for example, Digital Agent.
2. display_information.description: your app description, for example, Digital Agent.
3. features.bot_user.display_name: your bot name, for example, Digital Agent.- Click Save Changes.
- A notification is prompted asking to generate an app level token.
Figure: App Manifest
Figure: App Notification - Click Click here to generate, and you will be prompted with a dialog Generate an app-level token to enable Socket Mode.
- Specify values for the following fields:
- Token Name: socket-mode
Figure: App-level token to enable Socket Mode
- Token Name: socket-mode
- Click Generate.
- A dialog socket-mode will be prompted with the token in the dialog. Copy it for the later use while configuring Slack.
- Click Done.
Connecting to Slack using public HTTP endpoint
Connect to Slack using HTTP after Digital Agent server is configured and started.
The event request URL and the interaction request URL must be configured in your Slack App if you are using an HTTP endpoint to receive Slack events.
If the IP address of your Digital Agent server is public, you can use the Chatbot messaging endpoint URL <httpEndpoint.protocol>://<httpEndpoint.hostName>:<httpEndpoint.port><httpEndpoint.basePath> directly. Otherwise, you must configure your own network firewall or use some proxy servers to make sure that your Slack App of your Slack workspace in public cloud can access the messaging endpoint of Digital Agent server from Internet.
Note
You can find the values for protocol, hostName, port, and basePath in the configuration file DIGITALAGENT_HOME/config/chattools/slack.yaml. Where,
- <httpEndpoint.protocol>: the default value is https;
- <httpEndpoint.hostName>: the host name where your Digital Agent chatbot server is installed;
- <httpEndpoint.port>: the default value is 5001;
- <httpEndpoint.basePath>: the default value is /api/v1/messaging/webhooks/.
To connect Slack using public HTTP endpoint, perform the following steps:
- Open Slack API in your browser.
Click your Slack App.
Note
You must log in your Slack workspace before you can see your App in Slack.
- Configure your Slack App.
- In the left sidebar of Slack App dashboard, click Features > App Manifest to configure your Slack App.
In the manifest, specify values for the following fields:
Note
You should delete the default manifest, and then fill in the manifest.
- display_information.name: your app name, for example, Digital Agent.
- display_information.description: your app description, for example, Digital Agent.
- features.bot_user.display_name: your bot name, for example, Digital Agent.
- Click Save Changes.
- A notification pops-up mentioning that the URL is not verified. Ignore this notification, and configure the request URL after the Digital Agent server is configured and started.
Figure: Notification - App Manifest
Configure the request URL for events subscriptions for your created Slack App.
Note
Configure the request URL for events subscriptions after your Digital Agent server is configured and started.
- In the left sidebar of Slack App dashboard, click Features > Event Subscriptions.
- In the request URL input field, use the Digital Agent messaging-endpoint URL directly if it is publicly accessible. Otherwise, fill in with your public proxy URL that transmits network payload to Digital Agent web hook URL.
Figure: Enable events - Event Subscriptions - Click Save Changes.
Step 3: Installing the Slack App
Install the Slack App to your workspace before Digital Agent can start conversation in Slack channel.
To install the Slack App, perform the following steps:
- Install the Slack App.
- Request to install the App.
- In the left sidebar, click .
Click Request to Install. A dialog box will prompt to add an optional note to the administrator to request an approval. Add an optional note to the administrator and then wait for the administrator of your Workspace to approve. You will receive an email as well as a notice from the Slack bot of your Workspace when the approval is done.
Figure: Install ApprovedNote
Refresh the web page after receiving an email or a notice confirming approval of your Workspace. Now, install your app to your Workspace.
- Install the App to Workspace.
- Open Slack App dashboard at Slack API after getting approval for your Workspace.
- Click the App name that you created.
- In the left sidebar, click .
- Click Install to Workspace.
- A new page will open.
Figure: Request permission - Click Allow.
- The Slack App is installed.
- Request to install the App.
Save this signing secret. You will need it to configure your Slack in later steps.
Adding bot user to your Slack channel
You can add the bot user that you created to your Slack channel in two ways: either mention your bot user directly in the message field or click the link Add an app at the beginning of your Slack channel.
To add bot user to your Slack channel, follow either of the two methods mentioned below:
A. Mention your bot user directly in the message field
B. Click the link Add an app at the beginning of your channel
Confluence Cloud Migration Alert: Please refer to known issues you may encounter in Confluence Cloud: https://eitdocs.atlassian.net/wiki/x/wDGwAQ