[Connections] Slack
Q100094: [Connections] Slack
The Slack Connection
is a definition which tells a module, how to connect to and communicate with a Slack account and channel. Connections can either be entered directly into the parameter in the module, or can be centrally managed through the global connections tool. If you will be using the same connection in different modules, it is much easier to manage the connection information by creating a global connection. Whether you use a locally defined value in each SQL Server module, or use the global definitions for your Slack based modules, the format of the connection value is the same for both.
If you use the global connection manager, you will see that as soon as you create a new entry, it will provide you a template for starting your Slack Connection
definition. It would look like the example below.
Token=<token>;Channel=<channel>;
We see from this that the connection needs values for two different settings. It needs the value for the Token
and the Channel
setting. The Channel
setting is the channel name that should be used by default. You have the option to override this and use a different channel in the [Slack] Send Message
module. To get the values for these go to the Slack website and login to your account and follow the steps below.
Getting Slack Coonfiguration Values
- Open browser and go to https://api.slack.com/apps
- Create a new app
- Give the new app a unique name
- Choose workspace
- Under
Features
/OAuth & Permissions
- Select
Scopes
- Under
User token scopes
addChat:Write
andFiles:Write
- Scroll to top and under
OAuth Tokens for Your Workspace
, clickInstall To Workspace
- Click
Allow
to grant permissions - Copy the text value shown for
User OAuth Token
- Paste the text value copied in the previous step to the value for
Token
in theSlack Connection
setting in your JobServer module. - Find the name of the channel you want to post messages to and use that for the value in the
Channel
setting in your JobServer connection.
When you fill in your information, it should look something like the example below. Note that the values in the example below are not real/valid information and will not work. They are only for illustrative purposes.
Token=abcd-1234567890123-4567890123456-7890123456789-abcdefghijklmnopqrstuvwxyz123456;Channel=mychannel;