How to configure Slack in your on-prem Knowi
To use Knowi’s new Slack integration you’ll need to create an app in the Slack bot app. Navigate to Your Apps on https://api.slack.com/apps and click Create new App.
After naming your app and connecting your workspace, navigate to Basic Information. Here you’ll find your App ID, Client ID, Client Secret, and Signing Secret that lets your app access the Slack API.
Here’s where you’ll connect your on-premise Knowi instance to your newly created Slack app. Copy your App ID, Client ID, Client Secret, and Signing Secret to your cloud9.properties file in your Knowi server.
Your cloud9.properties can be found in
<Knowi Directory>/conf/cloud9/cloud9.properties
slackAppId=<slack app id>
slackClientId=<slack client id>
slackClientSecret=<slack client secret>
slackSigningSecret=<slack signing secret>
Now that you’ve created your app and updated your Knowi config, you can navigate to Interactivity & Components under Features.
Click Enable Interactive Components and you’ll be able to enter your Request URL (this is the location of your on-premise Knowi) and Options Load URL:
Request URL: https://www.your-knowi-server.com/slack/interactions
Click Save Changes and Slack will confirm if the HTTP request to the URL you entered succeeds or fails.
Navigate to Slash Commands under Features to configure the commands.
Click Create New Command, enter the Command, Request URL, Short Description, and Usage
Command: /knowi
Request URL: https://www.your-knowi-server.com/slack/knowi/
Short Description: query your data on Knowi directly on slack with NLP
Usage Hint: what are my total sales this week
Click Save.
Navigate to OAuth & Permissions under Features to configure the Redirect URLs.
Click Add New Redirect URL, enter the URL, and click Add. The URL will look like:
https://www.your-knowi-server.com/slack/callback
Click Save URLs.
On the same page under Scopes in the Bot Token Scopes, click on Add an OAuth Scope and select the following from the dropdown menu:
channels:join
channels:read
chat:write.public
files:write
groups:read
In the User Token Scopes, click on Add an OAuth Scope and select
files:write
Note: You have the option to set Restrict API Token Usage on this page if you want to ensure your Slack is the only one talking to your Knowi instance.
click on Allow to authorize and install the Knowi Slack app to your workspace.
Navigate to Manage Distribution under Settings menu and copy Sharable URL. This value will be used for slackOAuthAuthorizeUrl inside Knowi cloud9.properties file:
slackOAuthAuthorizeUrl=<slack authorization url>
The slack OAuth link copied above will resemble:
slackOAuthAuthorizeUrl=https://slack.com/oauth/v2/authorize?client_id=12313221.131231589&scope=channels:read,chat:write,chat:write.public,commands,files:write,groups:read&user_scope=files:write
Navigate to App Home and edit How Your App Displays
Click Edit and give your Knowi app bot a name (this is the name that will be displayed when alerts are triggered)
Your Knowi cloud9.properties file should have the following configurations:
slackAppId=<slack app id>
slackClientId=<slack client id>
slackClientSecret=<slack client secret>
slackSigningSecret=<slack signing secret>
slackOAuthAuthorizeUrl=<slack authorization url>
After updating your cloud9.properties you need to restart your Knowi server and begin using the Slack app with Knowi!
Please sign in to leave a comment.
0 comments