Apex Reference for Slack

Use Apex classes in the Slack namespace to simplify your Slack app development.

The Slack namespace provides classes and methods for interacting with your Slack apps, such as creating handlers for Slack actions and events, and getting access to a Slack client.

Before you create a handler, you must configure the connection and view definition for your Slack App. When creating your handler, extend the dispatcher based on the type of operation you’re handling.

  • Actions: Slack.ActionDispatcher
  • Commands: Slack.SlashCommandDispatcher
  • Events: Slack.EventDispatcher
  • Shortcuts: Slack.ShortcutDispatcher

To determine which classes and methods you need for your app, review the permission scopes your app requires to perform the tasks.

For more information, see Handle Slack Actions.

To make a call to Slack from an Apex trigger, use the @future annotation, queuable apex, or another asynchronous method.