Configuring Slack

This document provides detailed instructions for configuring Slack in channels-connector

Prerequisites

  • Active Slack workspace

Step 1: Create application

  1. Navigate Slack API console.
  2. Click Create a new app.
  3. In the popup please select From an app manifest

  1. Select workspace you want your Bot app to work in and click Next

  1. In the popup that will be shown please paste following JSON file
   {
    "display_information": {
        "name": "SentiOne Automate App",
        "description": "SentiOne Automate chatbot",
        "background_color": "#00994d"
    },
    "features": {
        "bot_user": {
            "display_name": "SentiOne Automate Bot",
            "always_online": false
        }
    },
    "oauth_config": {
        "redirect_urls": [
            "https://chatbots-admin.example.com"
        ],
        "scopes": {
            "user": [
                "im:write",
                "chat:write",
                "files:write",
                "im:history",
                "users:read"
            ],
            "bot": [
                "chat:write",
                "files:write",
                "im:history",
                "im:read",
                "users:read"
            ]
        }
    },
    "settings": {
        "event_subscriptions": {
            "request_url": "https://channels-connector.example.com/webhooks/slack",
            "user_events": [
                "message.im"
            ],
            "bot_events": [
                "message.im"
            ]
        },
        "interactivity": {
            "is_enabled": true,
            "request_url": "https://channels-connector.example.com/webhooks/slack/interactivity"
        },
        "org_deploy_enabled": false,
        "socket_mode_enabled": false,
        "token_rotation_enabled": true
    }
}
  1. Replace https://chatbots-admin.example.com with Public URL of admin application

  2. Replace https://channels-connector.example.com with Public URL of channels connector application

  3. Replace bot display name and app name if needed with desired values

  4. Click Next

  5. Check all the details in confirmation window

  6. Click Create

  7. Write down all the secrets from section called App credentials

  8. Expand Manage distribution section

  1. Click on Distribute App button

  2. Fill in the form

  1. Click on Activate Public Distribution

  2. Navigate to App Home section

  3. Make sure is Allow users to send Slash commands and messages from the messages tab is selected

Step 2: Configure channels connector application

  1. Navigate to application configuration repository
  2. Open following file in text editor of your choice ENV_NAME/kubernetes/helm/automate/values.yaml
  3. Add following section to the value under key chatbots.config.commonConf
    chatbots.channels-connector.slack {  
        enabled: true
        # Automate Chatbot APP
        client-id: "PUT_CLIENT_ID_FROM_CREDENTIALS_SECTION",
        client-secret: "PUT_CLIENT_SECRET_FROM_CREDENTIALS_SECTION"
        signing-secret: "PUT_SIGNING_SECRET_FROM_CREDENTIALS_SECTION"
    }
    
  4. Replace placeholders with values copied from App Credentials section obtained in first section of the guide
  5. Commit the changes and push to git server
  6. Deploy config changes to your Kubernetes cluster.

Step 3: Create slack channel

  1. Follow steps in channel configuration manual