Define an App
Define your app using the SlackApp metadata type. In your SFDX project, create the app definition in the
An app definition includes:
<appname>.slackapp: The configuration file that contains the app handlers for slash commands, shortcuts, and event handlers in YAML format
<appname>.slackapp-meta.xml: The metadata file that contains connection settings to communicate with Slack
Bind an action to handle each command, shortcut, and event in your app.
An action executes when a Slack request is received. Actions are assigned to hooks in app metadata and events in a view.
This example app configuration binds actions to several commands, a global shortcut, a message shortcut, and an event.
The app configuration includes the following keys.
|String||No||A description of the app. Not used in code.|
|Object||No||A map of slash command keys to action bindings that handle the slash commands. Define a key for each slash command that you defined in your Slack app at api.slack.com/apps. A slash command must start with |
|Object||No||A map of global shortcut callback ID keys to action bindings that handle the global shortcuts. Define a key for each global shortcut that you defined in your Slack app at api.slack.com/apps.|
|Object||No||A map of message shortcut callback ID keys to action bindings that handle the message shortcuts. Define a key for every message shortcut that you defined in your Slack app at api.slack.com/apps.|
|Object||No||A map of event keys to action bindings that handle the events. Define a key for each event that your Slack app subscribes to at api.slack.com/apps.|
An action binding is an object that represents a command, global shortcut, message shortcut, or event.
The action binding is specified by the following keys.
|String||Yes||The address to an Apex class in the format |
|String||No||Reserved for future use.|
|String||No||A description of the action binding. Not used in code.|
Configure your Apex SDK for Slack app to communicate with the Slack app. In the
slackapps folder, create a file called
<appname> matches the
For field information, see SlackApp metadata type.