Slack
Cyclr Partner Setup
Slack uses OAuth 2.0 for authentication so you need to register your Cyclr Partner with Slack to obtain your Client ID and Client Secret values.
From https://api.slack.com/apps, select the Create an App button:
Select From scratch then enter the:
App Name - a name for your App. This will be shown on-screen when users install the Slack Connector, and also appear as the username when you post to Slack.
Development Slack Workspace - which Slack Workspace your App belongs to. This just gives it a “home” and doesn’t prevent it from being installed in other people’s workspaces.
Redirect URL
You must add a Redirect URL to allow a Slack Connector to be installed successfully within Cyclr.
After you’ve created your App, set its Redirect URLs by going to Add features and functionality > Permissions:
Then Redirect URLs.:
Add a new Redirect URL for your Cyclr Console’s Service Domain which is in this format:
https://{Cyclr Service Domain}/connector/callback
You can find your Cyclr Console’s Service Domain in your Cyclr Console under Settings > General Settings.
Request Scopes
In Slack, scroll down to the Scopes section and click to Add an OAuth Scope.
Scopes can be modified at a later stage by navigating to the OAuth & Permissions sidebar.
For example, if you add the chat:write
scope to your Bot Token, it allows your app to post messages. If you add the channels:read
, your app can access data about public Slack channels.
Add scopes to your Bot Token, not your User Token.
You only require a User Token if you need to act as a specific user - for example, posting messages on behalf of a user, or setting a user’s status.
Get Your App Credentials
To retrieve your Client ID and Client Secret values, go to Basic Information on the left then scroll down to App Credentials.:
Distribution (Optional)
If you want workspaces other than your own to use the app, Slack now requires you to activate public distribution:
Navigate to your Basic Information page, select the dropdown for Manage Distribution and select Distribute App.
This screen shows any redirect URLs and features you have setup.
Follow the steps in Remove Hard Coded Information and make sure you select Use HTTPS For Your Features.
Select Activate Public Distribution to make the app available to others, outside of your workspace.
Cyclr Setup
To set up the Slack connector in Cyclr, go to your Cyclr console:
Go to Connectors > Application Connector Library.
Use the search box to find the Slack connector.
Select the Setup Required icon.
Enter the below values:
Value | Description |
---|---|
Client ID | The client ID of the Slack account. |
Client Secret | The client secret of the Slack account. |
Scope | Optional: You can specify scopes instead of using the default ones. |
Select Save Changes.
If you leave any values blank, Cyclr asks for their values when you install the connector into an account. This means you can use different settings for different accounts
Slack Events/Cyclr Webhook Setup
The Cyclr Slack Connector supports webhooks so you can subscribe to Slack events such as File Created and File Shared events. These events use Cyclr's Partner-level single URL webhook.
Retrieve the partner level webhook URL
In your Cyclr console:
Go to Connectors > Application Connector Library.
Locate the Slack entry and edit it.
Select the Settings tab.
Make a note of the Webhook URL. This is your Partner-level webhook URL used when working with any Slack Connectors in that Cyclr Console and its Accounts.
Setup events in Slack
On the Slack API App page for your Slack App. You can find Slack's documentation on this here.
Select Event Subscriptions in the left-hand menu.
Set Enable Events to On.
Enter the webhook URL found in the previous section in the Request URL field. You will see a green Verified if the URL is valid.
Select Subscribe to bot events to expand the section.
Select Add Bot User Event.
Enter the event name corresponding to the Slack Connector’s Webhook Method you wish to use:
Slack Connector Method | Slack Event |
---|---|
File Created | file_created |
File Shared | file_shared |
App Mentioned | app_mention |
Channel Message Posted | message.channel |
Direct Message Posted | message.im |
Message Posted | message |
Multiparty Direct Message Posted | message.mpim |
Private Message Posted | message.group |
Select Save Changes at the bottom of the page.
Any scopes missing from your Slack App are automatically added based on the events you entered.
Setup the webhook in a cycle
In the cycle where you want to add the webhook, drag the appropriate Webhook Method into the Builder and connect to other Steps as normal.
You do not need to use the webhook URL from the webhook step as all requests will arrive there via the Cyclr Partner-level webhook URL you entered into your Slack App. They will then be routed by Cyclr to the correct Slack Connector and Cycle.