Slack integration setup
Follow the series of instructions on this page to set up the Slack integration with your intranet.
For administrator information about the Slack integration and how to use it once it is set up, see Slack integration.
Create app on the Slack site
- Go to api.slack.com/apps. Click Create New App to create the app.
- In the Create an app window that appears, select From scratch, enter an App Name. This name will be visible throughout the Slack integration, eg. activity messages are posted by the App Name rather than a person's name. We recommend using or incorporating your intranet name in the App Name.
- Select your company Slack Workspace from the dropdown menu. (You will need to log in to the Slack website to see it listed as an option).
- Click Create App. You will be redirected to the Settings: Basic information screen.
Copy credentials to the intranet
- On your intranet, go to the Admin panel: Integrations section > Slack page. Change the Enable toggle to ON. (Slack integration can be enabled at any time, but must be enabled in order to set up Event Subscriptions/Link previews later in this process.)
- In Settings: Basic information on the Slack website, scroll down to App credentials.
- Copy the following values and paste them into the corresponding fields on your intranet on the Admin panel: Integrations section > Slack page, in the App configuration tab.
- App ID
- Client ID
- Client secret (click Show to be able to copy the value)
- Signing secret (click Show to be able to copy the value)
- Click Save at the bottom of the Slack integration screen on your intranet. You should see a notification at the top of the screen that the App configuration saved successfully.
Add display information (optional)
These settings are optional and can be set up at any time.
- In Settings: Basic information, scroll down to Display information.
- In the Short description field, enter a description of what the app does. eg. [App name] pushes helpful content from [intranet name] to Slack. Search for and share [intranet name] content right from Slack.
- Under App icon & Preview, click Add App Icon to upload an icon for your app in Slack. This icon displays beside the App Name whenever an activity message is posted or a link is unfurled in Slack. We recommend using your intranet logo or favicon here.
- Click in the Background color field and select a color. This color appears in the header of the window that pops up when the app name is clicked on in Slack.
Add scopes
- Navigate to Features: OAuth & Permissions.
- Scroll down to Scopes. Here you will specify exactly how the app needs to access a Slack user's account.
- Under Bot Token Scopes, click Add an OAuth Scope. In the field that appears, start typing the scope you want to add, and click on it in the dropdown menu when it appears to add it. Repeat to add more scopes. Add the following scopes:
- links:read
- links:write
- team:read
- commands
- chat:write
- channels:read
- Under User Token Scopes, click Add an OAuth Scope. You will need to add the following scopes:
- links:read
- links:write
- team:read
- identify.
- Under Bot Token Scopes, click Add an OAuth Scope. In the field that appears, start typing the scope you want to add, and click on it in the dropdown menu when it appears to add it. Repeat to add more scopes. Add the following scopes:
Copy token to intranet
- Scroll to the top of Features: OAuth & Permissions and click Install to Workspace. Click Allow to allow the Slack App to access the Slack workspace.
- You will be redirected to the Features: OAuth & Permissions screen. Under OAuth Tokens, copy the Bot User OAuth Access Token.
- Open your ThoughtFarmer Admin Panel and navigate to the Slack integration page. Under the App configuration tab, paste the Bot token.
- Click Save at the bottom of the Slack integration screen on your intranet. You should see a notification at the top of the screen that the App configuration saved successfully.
Add a Redirect URL
- Go back to the Slack website under Features: OAuth & Permissions.
- Under Redirect URLs, click Add New Redirect URL. Enter your site's URL, e.g. https://mysite.thoughtfarmer.com
- NOTE: Please refrain from adding a forward slash after the ".com" in the redirect URL option to avoid encountering CORS errors.
- Click Add.
- Click Save URLs.
Configure event subscriptions to enable link previews (optional)
Setting up event subscriptions allows users to post intranet URLs in Slack and have them expand, or unfurl, to show the page title, thumbnail image (if available) and a summary or excerpt of the page content.
- Navigate to Event Subscriptions to enable Link previews.
- Turn the Enable Events toggle to On.
- In the Request URL field, enter your intranet URL and add /slack/action to the end. eg. https://mysite.thoughtfarmer.com/slack/action
- Click on the App unfurl domains section to expand it.
- Click Add Domain and enter your site's domain in the field that appears. eg. https://mysite.thoughtfarmer.com
- Click Done.
- Click Save Changes at the bottom of the screen.
- A message may appear at the top of the screen to reinstall your app for these changes to take effect. We'll do that step later in the process.
Configure slash command to enable intranet search (optional)
Setting up a slash command allows users to search the intranet and post a search result directly in Slack.
- Navigate to Features: Slash Commands to enable Search.
- Click Create New Command. You will be taken to the Create New Command screen.
- In the Command field, enter a /command that users will type to perform a search of your intranet from Slack. eg. /searchintranet.
- On your intranet at Admin panel: Integrations section > Slack page, under the Link previews and search tab, there is a field called Search: slash command. This field is available as a place to record your search slash command. Copy your slash command into this field for later reference. Note that this field is not connected to the Slack app, and any changes to the command must be made in Slack and updated manually on the intranet.
- In the Request URL field, enter the request URL. eg. https://mysite.thoughtfarmer.com/slack/search
- In the Short Description field, enter a description of what the slash command does. eg. Searches [your intranet name]
- Click Save at the bottom of the screen.
- In the Command field, enter a /command that users will type to perform a search of your intranet from Slack. eg. /searchintranet.
Configure interactive components
- Navigate to Features: Interactivity & Shortcuts.
- Turn the Interactivity toggle to On.
- In the Request URL field, enter your intranet URL and add /slack/interaction to the end, eg. https://mysite.thoughtfarmer.com/slack/interaction
- Click Save Changes at the bottom.
Reinstall the App
- Navigate to Features: OAuth & Permissions.
- Under Tokens for Your Workspace, click Reinstall App.
- Click Allow to allow the Slack App to access the Slack workspace.
For administrator information about the Slack integration and how to use it once it is set up, see Slack integration.
Comments
0 comments
Please sign in to leave a comment.