Configure Slack app
Create a custom OAuth application on your Slack workspace to enable OAuth 2.0 authentication with the Slack spoke.
Before you begin
Role required: admin
About this task
Complete these steps from your Slack account. You can create an app or configure an existing app as per the configurations outlines here.
Procedure
-
Create a Slack workspace.
To learn how to create a workspace, see Create a Slack workspace.The following image shows a typical Slack workspace.
- Navigate to the Slack API console.
- Click Create an app.
-
On the Create an app window, select the most appropriate method to create the app.
-
From the App Credentials page on the Basic Information page, copy and record the values of Client ID, Client Secret, and Signing Secret of your Slack app.
For more information, see the Obtain Client ID and Client Secret for later step.
-
On the OAuth & Permissions page:
- Specify the ServiceNow instance URL in Redirect URLs in this format: https://<instance-name>.service-now.com/oauth_redirect.do.
-
Add these
bot
token scopes:
- channels:history
- channels:manage
- channels:read
- chat:write
- chat:write.customize
- groups:read
- im:read
- mpim:read
- groups:history
- groups:write
- im:history
- im:write
- mpim:history
- mpim:write
- users:read
- users:read.email
- files:read
For more information, see Scopes and permissions.
Note:The spoke set up procedure outlined here requires bot user tokens only. You can't use the Create User and Deactivate User actions while using the bot token scopes. To use these actions, you must obtain user token from your Slack account.
-
On the Slash Commands page, create a command and specify these values:
Field Value Command /now Request URL https://<instance-name>.service-now.com/api/sn_slack_ah_v2/command_service/<slack-app-name> Short Description Description about the command. Usage Hint List of parameters than can be passed. For example, [operation] [table]. For more information, see the Creating a Slash command step.
-
On the Interactivity & Shortcuts page:
-
Enable Interactivity and specify the ServiceNow instance URL in Request URL in this format:
https://<instance-name>.service-now.com/api/sn_slack_ah_v2/slack/<slack-app-name>/interactivepayload
.
For more information, see the Preparing your app for user interactions section.
-
Create a shortcut that appears on messages and enter the value, post_message_now for Callback ID.
For more information, see the Creating a shortcut section.
-
Enable Interactivity and specify the ServiceNow instance URL in Request URL in this format:
https://<instance-name>.service-now.com/api/sn_slack_ah_v2/slack/<slack-app-name>/interactivepayload
.
-
Create a Slack bot and add the bot to your Slack app and required channels.
For more information, see Create a bot for your workspace.