Slack
Register OAuth2 app
Go to https://api.slack.com/apps and create a new app.

Name your application and select a workspace.

Basic Information
Then you receive your clientID, clientSecret and signingSecret.

After that create an App-Level Token with the following scopes: authorizations:read. This token is used to verify authorization of the user for incoming Events API requests from Slack: an event is delivered only to the triggers of the workspace it came from. The New Channel Message trigger requires it. Without it, the New User trigger receives a new user only when the trigger's owner is the installation named in the event, so other New User triggers of the same workspace miss it.


Copy and paste those values into the Backoffice.
clientIdis theClient IDfrom the Slack app.clientSecretis theClient Secretfrom the Slack app.authTokenis theApp-Level Tokenfrom the Slack app.signingSecretis theSigning Secretfrom the Slack app (just under Client Secret).

OAuth & Permissions
Redirect URL
The next thing is adding the redirect URL and scopes.
Example redirect URL: https://api.YOUR_SUBDOMAIN.appmixer.cloud/auth/slack/callback

Bot Scopes
In order to be able to send messages as bot to channels, you have to add these scopes in the OAuth & Permissions section, specifically in the Bot Token Scopes section.
chat:write
Send messages as @BOT
chat:write.customize
Send messages as @BOT with a customized username and avatar
chat:write.public
Send messages to channels @BOT isn't a member of
User Scopes
In order to be able to work with channels and groups as user, you have to add these scopes in the OAuth & Permissions section, specifically in the User Token Scopes section.

In order to use the application accross workspaces you have to distribute it.


Events API
Some components (New Channel Message or New User) use Slack Events API (https://api.slack.com/events-api). In order to use this components in Appmixer, you have to register Appmixer's Slack URI in Slack first.
Go to https://api.slack.com/apps then choose your Appmixer app.
Go to your app settings (https://api.slack.com/apps/{your-app-id}/event-subscriptions)

The Request URL has to point to your Appmixer backend server. The rest of the URL /plugins/appmixer/slack/events has to remain like this. Your Appmixer backend server has to be running before you enter the URL. Slack will immediately try to connect to that URL.
Then you need to subscribe to these events:
message.channels,message.groupsfor theNew Channel Messagecomponentteam_joinfor theNew Usercomponent

Don't forget to hit Save Changes:

You can now use the appmixer.slack.list.NewChannelMessageRT component in a flow.
Slack app migration
In Appmixer 4.2 the Slack module was upgraded. We did remove all the legacy API and switched to their newest API. For some time, it was possible to use the Appmixer Slack module with both legacy Slack apps and the new Slack apps. But the legacy apps are deprecated and will retire in August 2021 (https://api.slack.com/legacy/workspace-apps). If you use the legacy Slack app, you either have to create a new Slack app or migrate the existing one.
In order to migrate your Slack legacy app, go to Oauth & Permission section.

Then scroll down to Scopes and hit the Update Scopes button.

Ignore the first page, because that's all about scopes for bots.

Scroll all the way down and hit continue. You get to a second page with user scopes.

Select channels:read, channels:history, channels:write, groups:read, groups:write, groups:history, chat:write and users:read.
Verify the scopes and migrate the app.

And confirm. The Appmixer Slack module since version 4.2.1 is already updated and ready for the new Slack apps.

Flows that use the SendPrivateChannelMessage component won't work. The component will appear unauthenticated. The reason is a different Oauth scope in the new Slack app version. In this case, the user has to authenticate the component again.
Backoffice configuration
Configuration ID: appmixer:slack. See Connector Configuration for how to set it in the Backoffice.
clientId- theClient IDfrom Basic Information of the Slack app. Not needed with the Auth Hub.clientSecret- theClient Secretfrom Basic Information of the Slack app. Not needed with the Auth Hub.signingSecret- theSigning Secretfrom Basic Information. Verifies that Events API requests come from Slack; required for theNew Channel MessageandNew Usertriggers. Not needed with the Auth Hub.authToken- the App-Level Token with theauthorizations:readscope. Scopes incoming events to the workspace they came from; required forNew Channel Messageand needed byNew Userto reach every trigger of the workspace. Not needed with the Auth Hub.botToken- optional, legacy. A bot token (xoxb-...) used for messages sent as the bot when the account carries none; accounts connected with the Slack connector 4.1.4 or newer carry their own.
Last updated
Was this helpful?

