# Setting Up a Slack Channel

The Aisera Platform enables seamless integration with Slack as a channel, allowing Aisera Applications to interact with users and send alerts directly to Slack channels.&#x20;

If you plan to retrieve data from Slack conversations, consult the [Slack Connector](https://docs.aisera.com/aisera-platform/adding-data-to-your-tenant/integrations-and-data-sources/learning-functions-for-external-data-sources/slack-connector) documentation for detailed guidance.

## Create a Slack Application

To connect Slack to the Aisera Platform you will need to create a Slack Application. This can be done by creating the application using a manifest (recommended), or by creating the Slack application from scratch.

To create a Slack application:&#x20;

1. Login to the Slack workspace being connected to the Aisera Platform.
2. Go to[ https://api.slack.com/apps](https://api.slack.com/apps)
3. Click **Create New App.**

<div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfWkv5Y-UzyQusBaF8pFiljRmjNbN6CPbtRSCEF1SZNYMKmg6f_b1sLwQH_ygdZ-Pn7XU9WIDKHiy9uzRflZGjUseaCqKX1Ncnw0Eu6BpeQ41FaeYTULno_by_1CBA2pA8kUZP0TbEE8aSD_cebwhLPxwrt?key=xG4DZ3SXidBZT2wwz8F1nA" alt="" width="563"><figcaption><p>Create a New Slack App</p></figcaption></figure></div>

### Create an App Using a Manifest File

1. In the **Create an App** window, choose **From a manifest.**
2. Select the Workspace to be connected to the Aisera Platform.
3. Modify the `manifest.json` file below:
   1. Replace *every* instance of `<tenant_id>` with your tenant Id.
   2. Customize the `name`, `description`, `long_description`, `background_color`, and `display_name` fields to personalize your Slack bot.<br>

      ```json
      {
          "display_information": {
              "name": "MY-GPT-ABC",
              "description": "I'm Grace, your HR expert! I'm here to help you troubleshoot common technical issues!",
              "background_color": "#cf1717",
              "long_description": "I'm Grace, your HR expert, here to answer your Business Technology questions! I'm here to help you troubleshoot common technical issues, find answers to your IT questions, and guide you through simple solutions!"
          },
          "features": {
              "bot_user": {
                  "display_name": "Grace (GPT-ABC)",
                  "always_online": true
              }
          },
          "oauth_config": {
              "redirect_urls": [
                  "https://<tenant_id>.login.aisera.cloud/"
              ],
              "scopes": {
                  "bot": [
                      "app_mentions:read",
                      "channels:history",
                      "channels:manage",
                      "channels:read",
                      "chat:write",
                      "groups:history",
                      "groups:read",
                      "im:history",
                      "im:read",
                      "im:write",
                      "links:write",
                      "mpim:history",
                      "mpim:read",
                      "reactions:read",
                      "reactions:write",
                      "users.profile:read",
                      "users:read",
                      "users:read.email",
                      "chat:write.customize"
                  ]
              }
          },
          "settings": {
              "event_subscriptions": {
                  "request_url": "https://<tenant_id>.chatbot.aisera.cloud/slack/receive",
                  "bot_events": [
                      "app_mention",
                      "message.channels",
                      "message.groups",
                      "message.im",
                      "message.mpim",
                      "reaction_added"
                  ]
              },
              "interactivity": {
                  "is_enabled": true,
                  "request_url": "https://<tenant_id>.chatbot.aisera.cloud/slack/receive",
                  "message_menu_options_url": "https://<tenant_id>.chatbot.aisera.cloud/slack/receive"
              },
              "org_deploy_enabled": true,
              "socket_mode_enabled": false,
              "token_rotation_enabled": false
          }
      }
      ```
4. Paste the modified manifest into the input field and click **Next**.
5. Review the configuration summary and click **Create** to finalize the app creation.
6. Navigate to **App Home > Show Tabs** and enable **Allow users to send Slash commands and messages from the messages tab**.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FM7PHstdQiAuJexK9MI4i%2Fslack_show_tabs.png?alt=media&#x26;token=3bc9e665-90f5-4d54-9372-12b3dfdf8cf4" alt="" width="563"><figcaption><p>Slack Show Tabs Window</p></figcaption></figure></div>

6. Navigate to **Event Subscription > Enable Events.**
7. Choose **Retry** to validate the configuration.
8. Click **Save**.
9. Navigate to **Install App** and select **Install to Organization**.

### Create a Slack App from Scratch

1. In the **Create an App** window, choose **From Scratch.**
2. Set the **App Name**.
3. Select the Workspace to be connected to the Aisera Platform.
4. Click **Create App** to create the application. This will redirect you to the **Basic Information** window for your new slack application
5. In the left navigation menu, click **Event Subscriptions.**
6. Toggle **Enable Events** on.
7. Set the Request URL to `https://chatbot.<tenant_id>.aisera.<top_level_domain>/slack/recieve`
8. Expand **Subscribe to bot events**, then click **Add Bot User Events**.
9. Add following events:
   1. `app_mention`
   2. `message.channels`
   3. `message.groups`
   4. `message.im`
   5. `message.mpim`
   6. `reaction_added`
10. Select **Save Changes.**
11. In the left navigation menu, click **Interactivity & Shortcuts.**
12. Toggle **Interactivity** on.
13. Set the Request URL to `https://chatbot.<tenant_id>.aisera.<top_level_domain>/slack/recieve`
14. Click **Save Changes**.
15. In the left navigation menu, click, **OAuth & Permissions.**
16. Under **Redirect URLs** click **Add New Redirect URL**.
17. Set the new redirect URL to `https://<tenant_id>.aisera.<top_level_domain>/`.

    <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>This is the URL you are presented with when logging into the Aisera Admin UI.</p></div>
18. Click **Save URLs**
19. Under **Scopes > Bot Token Scopes** click **Add an OAuth Scope** and add the following scopes:
    1. `channels:read`
    2. `channels:manage`
    3. `chat:write`
    4. `groups:read`
    5. `im:read`
    6. `im:write`
    7. `mpim:read`
    8. `reactions:read`
    9. `reactions:write`
    10. `users:read`
    11. `users:read.email`
    12. `users.profile:read`
20. In the left navigation menu, click **App Home.**
21. Under **Your App's Presence in Slack** next to **App Display Name** click **Edit**.
    1. Set your bot's **Display name**
    2. Set your bot's **Default username**
    3. Click **Save**
22. Toggle **Always Show My Bot as Online** to on.
23. Under **Show Tabs** set **Allow users to send Slash commands and messages from the chat tab** to on.

## Gathering Credentials

You will need to gather credentials for the Slack application you created to integrate Slack with the Aisera Platform.

1. Login to the Slack workspace being connected to the Aisera Platform.
2. Go to[ https://api.slack.com/apps](https://api.slack.com/apps).
3. Select the Slack Application you configured for integration with the Aisera Platform.
4. Under **App Credentials** copy down the following information for use later.
   1. **Client ID**
   2. **Client Secret**
   3. **Verification Token**

## Branding your Slack App

To modify or set the branding on your Aisera Application:

1. Access the Slack API page.
2. Select your Aisera Slack application to navigate to the **Basic Information** window for your slack application.
3. Set the following information under **Display Information:**
   1. **App Name**
   2. **Short Description**
   3. **App Icon & Preview** (512x512 PNG)
   4. **Background Color**
4. Click **Save Changes**

## Install the Aisera App into your Slack Workspace

The following steps need to be done by a workspace member with permission to install the channel within the application in Aisera Admin Console.

1. In the Aisera Admin UI navigate to **Settings > Channels**.
2. Click **+ Add New Channel**.
3. Select **Slack** and click **Next**.
4. Input the following configuration details, then click **Next**.

   <table><thead><tr><th width="198">Field</th><th>Description</th></tr></thead><tbody><tr><td>Channel name</td><td>The name the channel will be displayed under in the Aisera Admin UI</td></tr><tr><td>Client ID</td><td>The Client ID for the Slack Application created for integration with the Aisera Platform.</td></tr><tr><td>Client Secret</td><td>The Client Secret for the Slack Application created for integration with the Aisera Platform.</td></tr><tr><td>Verification Token</td><td>The Verification Token for the Slack Application created for integration with the Aisera Platform.</td></tr></tbody></table>
5. This will navigate you to a page requesting access to your Slack Workspace. Click **Allow**.<br>

   <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>Ensure the Workspace you are installing the application to is correct.</p></div>

   <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe8ZSNS1v7NkDLU57nU0erdw8fpGSpgkciAAHWc9_PU7_1IVlHaHFeeVVNDuO2e0S-qhHcGwQmfvIYeQiHfUX07gRUVM1ZFxwxWdhrVsFwCn0ncLYf7T6FhUq_y0Zf2MBK3q5DS0bj8fYIIiJuCjV1lX01c?key=xG4DZ3SXidBZT2wwz8F1nA" alt="" width="563"><figcaption></figcaption></figure></div>
6. You will be redirected back to the Aisera Admin UI. A success message should appear at the top of the screen.<br>

   <div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F3y7x2Fz4cmp7pWtFrrzd%2Fimage.png?alt=media&#x26;token=fcd11c85-7f72-4e67-ab43-9747bbcfad33" alt="" width="404"><figcaption></figcaption></figure></div>

## Connecting the Slack Channel to an Aisera Application

1. Navigate to **Settings > AiseraGPT.**
2. Select the Aisera application you would like to add the newly created Slack Channel to.
3. On the **App Details** page, scroll down to **Channels**.&#x20;
4. Click **+ Add Channel**.
5. Select the relevant **Slack** channel.
6. Click **OK**.&#x20;

## Setting up a Slack Silent Mode bot (Optional) <a href="#pdf-page-tzvqxf2sjh415oicpcf8-setting-up-slack-silent-mode-bot" id="pdf-page-tzvqxf2sjh415oicpcf8-setting-up-slack-silent-mode-bot"></a>

This section describes how to set up a Slack application in Silent Mode.

Verify the following requirements:

1. Your Slack application has been set up following the guidelines in [Create a Slack Application.](#create-a-slack-application)
2. The `reaction_added` event subscription is enabled in your Slack application.

### Adding the Slack Channels

1. Create two slack channels.
   1. One channel is for the bot **end users**
   2. One is for the **agents**
2. Integrate the two channels with your Slack bot using the Slack Application.
3. In the Aisera Admin UI navigate to **Settings > Channels**, then select your Slack Channel.
4. On the **Channel Details** window, click the **Edit** icon in the top right corner.
5. Under **Silent Mode Channels** select the Slack channel you created for your end users.
6. Under the **Agents Channel** select the channel you created for your agents.
7. Apply the desired configurations:

   <table><thead><tr><th width="212">Configuration</th><th>Description</th></tr></thead><tbody><tr><td>Make Conversation Public</td><td>When enabled, the bot will reply to users in the public channel’s thread if enabled. Otherwise, the bot will reply with a direct message.</td></tr><tr><td>Notify Channel when Answered</td><td>When enabled, the channel where the question was posted will be notified when an answer is found.</td></tr><tr><td>Handle All Messages</td><td>When enabled, the bot will handle all messages, regardless of the response confidence.</td></tr><tr><td>Show Multiple Intents</td><td>When enabled, multiple high confidence answers may be returned. Otherwise, only the highest confidence answer will be returned.</td></tr><tr><td>Use App Defined NLU Policy</td><td>If selected, all messages will have the same processing capability as regular conversation channels.</td></tr><tr><td>Enable Streaming Experience</td><td>When enabled, responses will be streamed and will be displayed incrementally. When disabled, messages will be sent all at once.</td></tr><tr><td>Remove Empty Blocks during Streaming</td><td>When enabled, empty blocks will be filtered from responses.</td></tr></tbody></table>
8. Press **OK** to save your changes<br>

   <div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FZ5JWRu6TXHcdutbKKlf1%2Fedit_channel_config.png?alt=media&#x26;token=895c3475-063b-4df2-8b02-af9f3f2d411c" alt="" width="563"><figcaption></figcaption></figure></div>

### **Set up Silent Mode Workflows**

You can use the following workflows with Slack Silent Mode.

#### Escalation Feedback Flow

Add the following **Escalation Feedback Flow** nodes to your Workflow if you have a configuration where users can choose to escalate to an agent.

1. Add the Escalation Silently Node to your AI Workflow Studio canvas.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FDlD98tGwex96m0FiPxZQ%2Fescalation_feedback.png?alt=media&#x26;token=7ebd2cbe-b901-43d3-8e61-4cd899bb1bfd" alt=""><figcaption></figcaption></figure></div>

2. Add an **Escalation Silently Action**.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FKg3et0RzUtNKCZFwvD1O%2Fescalate_silently.png?alt=media&#x26;token=8e129280-4e8c-4847-a36d-c98971afe7db" alt="" width="563"><figcaption></figcaption></figure></div>

2. Add a **Response Message.**

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F62E30OSDulJxwBDGO49k%2Fresponse_message_node.png?alt=media&#x26;token=f2e121c0-caba-4f90-a687-d98fa944ac5d" alt="" width="513"><figcaption></figcaption></figure></div>

#### HandleConversationEvent Flow

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FKv2PnfxoezSeOQ519G3t%2Fhandle_conversationa.png?alt=media&#x26;token=62a02eb3-1fba-4863-bfd8-412d02785ecb" alt="" width="563"><figcaption></figcaption></figure></div>

The workflow graph look like this:

<figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FCZYGQglCA9eODPt5iDEM%2Fhandle_conversationb.png?alt=media&#x26;token=6a101b8f-02b0-4d09-a59a-d84bfe32b70e" alt=""><figcaption></figcaption></figure>

#### LiveAgentPickUp branch

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FhcnE4A9vHMopBADRgMeN%2Fedit_brancha.png?alt=media&#x26;token=ba1e5979-f3e6-4327-bdfc-01ab3bb0e164" alt="" width="563"><figcaption></figcaption></figure></div>

Add a Silent Mode Follow Up Action for LiveAgentPickUp.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2Fy8nyEn452bffmmwYEUQg%2Fedit_branchb.png?alt=media&#x26;token=f9d7f859-81f3-43de-ab5c-72da5f19c194" alt="" width="563"><figcaption></figcaption></figure></div>

#### LiveAgentComplete branch

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2Fe6DoE9m0FbOJIMH8pmIF%2Fcomplete_branch.png?alt=media&#x26;token=93e34e2c-95eb-45ce-99d0-fc08502dde56" alt="" width="563"><figcaption></figcaption></figure></div>

Add a Silent Mode Follow Up Action for LiveAgentComplete.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F4ygGfvlxhFo3giGfWz3W%2Fsilent_mode_follow_up2.png?alt=media&#x26;token=99a0d913-1685-4845-bba5-a5eef4197f77" alt="" width="563"><figcaption></figcaption></figure></div>

#### ChimeInRequest branch

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2FiO8G1q5s6dEFZRe4rWo9%2Fchimein1.png?alt=media&#x26;token=4a83f26f-2cfe-44ba-92ed-52f416438617" alt="" width="563"><figcaption></figcaption></figure></div>

Edit the JavaScript for the ChimeInRequest branch.

<div align="left"><figure><img src="https://3281977978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvBFXjH9S1CAy9f5hzg5Q%2Fuploads%2F86j64UVwNHk6L3F9lY6L%2Fchimein2.png?alt=media&#x26;token=7f620960-a218-47d8-9ab0-a7a9b99a8b35" alt="" width="563"><figcaption></figcaption></figure></div>
