Skip to main content
Skip table of contents

Slack DM Integration

Overview

By integrating a Slack App with QueryPie, you can receive Direct Message notifications from QueryPie.

This document applies to QueryPie version 10.2.6 or later.

For instructions on Slack integration with version 10.2.5 or earlier, please refer to the 10.1.0 version manual.

Prerequisite Permissions for Configuration

  • Slack Workspace Administrator account: Required to install Apps in your Slack Workspace.

  • QueryPie Owner and Approval Admin permission accounts.

Creating DM App in Slack API (via Manifest File)

Create a dedicated Slack App for QueryPie DM integration using an App Manifest.

  1. Navigate to https://api.slack.com/apps and click Create an App.

  2. In the "Create an app" modal, select how you want to create the app. Click From a manifest.

    스크린샷 2025-02-18 오후 1.17.25.png

  3. In the "Pick a workspace" modal, select the Slack Workspace you want to integrate with QueryPie, then proceed to the next step.

  4. In the "Create app from manifest" modal, you will enter the App Manifest in JSON format. Delete any pre-filled content and paste the following App Manifest. Then, proceed to the next step.
    (전구) Remember to change the values within {{..}} to your desired values.

    CODE
    {
        "display_information": {
            "name": "{{name}}"
        },
        "features": {
            "bot_user": {
                "display_name": "{{display_name}}",
                "always_online": false
            }
        },
        "oauth_config": {
            "scopes": {
                "bot": [
                    "chat:write",
                    "users:read.email",
                    "users:read"
                ]
            }
        },
        "settings": {
            "interactivity": {
                "is_enabled": true
            },
            "org_deploy_enabled": false,
            "socket_mode_enabled": true,
            "token_rotation_enabled": false
        }
    }

  5. Review the settings and click the Create button to complete the App creation.

    image-20240115-220447.png

Installing Slack App to Slack Workspace

  1. In your newly created Slack App's settings page, navigate to Settings > Install App. Click the Install to Workspace button to install the app into your Slack Workspace.

  2. On the permission request page, click Allow.

    image-20240115-221520.png

  3. You should now see the dedicated Slack DM App created in your selected Slack Workspace.

    image-20240115-221618.png

Obtaining Bot User OAuth Token

In your Slack App's settings, navigate to the Features > OAuth & Permissions menu. In the "OAuth Tokens for Your Workspace" section, copy the Bot User OAuth Token and keep it for later use.

image-20240418-022640.png

Creating App-Level Token

Although Socket Mode and related permissions can be enabled when creating a Slack app with an App Manifest, an App-Level Token (which starts with xapp-) is not automatically generated.

  • App-Level Tokens are security credentials; automatic generation/exposure via a manifest would be a security risk.

  • The App Manifest only defines the app's configuration; actual authentication tokens are generated and managed separately.

Follow these steps to manually create an App-Level Token:

  1. In your Slack App's settings page, navigate to the Settings > Basic Information menu. Go to the "App-Level Tokens" section and click the Generate Token and Scopes button.

    스크린샷 2025-02-18 오후 2.09.51.png

  2. In the "Generate an app-level token" modal, click the Add Scope button and add the connections:write scope.

    스크린샷 2025-02-18 오후 2.15.55.png

  3. In the "App-Level Token generated" modal, copy the app token and store it securely for later use. Remember, App-Level Tokens start with xapp-.

Configuring Slack DM in QueryPie

  1. In QueryPie, navigate to the Admin > General > System > Integrations > Slack menu. Click the Configure button to open the settings modal.

    스크린샷 2025-03-10 오전 11.35.09.png

  2. In the settings modal, enter the App Token and the Bot User OAuth Token that you copied earlier.

  3. Configure the additional settings as needed. To receive Workflow notifications via DM and to approve/reject requests directly within Slack messages, enable all setting toggles:

    1. Send Workflow Notification via Slack DM: Enables sending Slack DMs for workflow requests.

    2. Allow Users to approve or reject on Slack DM: Enables approval or rejection functionalities directly within Slack DMs.

  4. Click the Save button to complete the setup.

Managing Slack DM Settings

  1. After registering the Slack Configuration, you can view the current setup status on the screen.

    스크린샷 2025-03-10 오전 11.39.50.png

  2. Click the Edit button to change the entered settings.

    스크린샷 2025-02-18 오후 3.28.40.png

Test Slack DM for Workflow Requests

Using a DB Access Request as an example, perform a test to ensure the Slack DM functionality is working correctly.

  1. In QueryPie, navigate to the User > Workflow page. Click the Submit Request button, select DB Access Request, and proceed to the request creation screen. Fill in the necessary information and submit the request.

    스크린샷 2025-02-18 오후 3.15.04.png

  2. The designated approver(s) will receive a DM notification from the Slack App you configured, informing them of the pending request.

    If the Allow Users to approve or reject on Slack DM setting is enabled, the approver can directly enter a reason and approve or reject the request within the DM.

    스크린샷 2025-02-18 오후 3.22.38.png

  3. Clicking the Details button in the DM will redirect the approver to the QueryPie Admin page, where they can view detailed information about the request and then approve or reject it.

    스크린샷 2025-02-18 오후 3.25.27.png
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.