Connect action in the Slack package

Authenticate to Slack by using a Control Room OAuth2 connection and create a reusable Slack session for later actions in the automation.

Prerequisite

Before using the Connect action, you must first create and configure a Slack app, generate the required bot token, and set up an OAuth connection in the Control Room by completing the following prerequisite:

Create a Slack app
  • Go to the Slack Developer Portal: https://api.slack.com/apps
  • Navigate to Your apps > Create New App
  • Choose From scratch.

    Create an app

  • Enter the following:
    • App Name: For example, AA Slack integration
    • Pick a workspace to develop your app in: select the Slack workspace where the app will be used

    Choose workspace

  • Click Create App.
Configure OAuth and permissions
  • After the app is created, in the left panel, navigate to OAuth & Permissions.
  • Navigate to Redirect URLs section. In the Redirect URLs field, enter the Callback URL from the Control Room connection settings.
  • Navigate to the Scopes section.

Add Bot Token Scopes: In the Scopes section, add required permissions depending on your use case. To add, click Add an OAuth Scope.

Some examples are listed below:
  • chat:write → Send messages as @AA Slack integration
  • channels:read → View basic information about public channels in a workspace
  • channels:history → View messages and other content in public channels that AA Slack integration has been added to
  • groups:read → View basic information about private channels that AA Slack integration has been added to
  • im:read → View basic information about direct messages that AA Slack integration has been added to.
Note:
  • Ensure you choose your scopes carefully as insufficient scopes might cause actions to fail later.
  • Currently only Bot Token authentication is supported.

Configure OAuth 2.0 connection: For information in creating a custom provider, see Configure OAuth 2.0 connection in Control Room.

Settings

  • In the OAuth connection field, click Pick to choose from available Control Room-managed OAuth2 credentials.​
    Note: Ensure the OAuth2 connection is valid and active in the Control Room.​
  • Click the Provider type drop-down menu to select an available or custom provider.
  • In the Connection name field, select the specific OAuth connection object.

    This field is disabled until a Provider type is selected.

  • In the Token type field, select one of the following options depending on the token that will be used at run time.
    • Shared: for a global token.

      An access token of shared type is created when a connection is established to the Control Room. This access token is stored as a credential. When you run your automation, the access token is referenced in the automation using the enterprise application provider type set up in the Control Room.

    • User-specific: for a token that is specific to a user.
  • In the Slack session field, use one of the following tabs for creating a session:
    • Local session: to specify a session name that can be used only in the current bot.
    • Global session: to specify a session name that can be used across multiple bots, such as parent bots, child bots, and all other child bots of the parent bot.

      Recommendation: The parent and child bots should have the same package version.

    • Variable: to specify a Slack session variable.