Slack interaction payloads
- 27 Jan 2023
- 2 Minutes to read
- DarkLight
Slack interaction payloads
- Updated on 27 Jan 2023
- 2 Minutes to read
- DarkLight
Article Summary
Share feedback
Thanks for sharing your feedback!
Create a Slack Interaction Payloads integration in Torq to trigger Torq workflows by getting notifications of user interactions with shortcuts, modals, or interactive components (such as buttons, select menus, etc) in Slack. The integration generates a unique endpoint that can be used by Slack to send data.
1. Create a Slack Interaction Payloads integration in Torq
Perform these steps in Torq.
- Go to Integrations > Triggers, search for the Slack Interaction Payloads card, and click Add.
- Enter a meaningful name for the integration, such as slack-interaction-payloads, and click Add.
- In the table, locate the integration you just created and copy the endpoint URL. You will enter this as the Request URL when subscribing to Slack interactive events.
2. Subscribe to interactive events and create shortcuts in Slack
Perform these steps in Slack: https://api.slack.com/apps/.
- Select an existing app or click Create an App and select the option to configure it From scratch.
- Specify a name for your app and select the Slack workspace you want to develop the app in.
- Once you've created the app, go to Interactivity & Shortcuts and set Interactivity to On.
- Enter the Slack Interaction payloads integration endpoint you created in Torq as the Request URL.
- You can create shortcuts by clicking Create New Shortcut and following Slack instructions. Create global shortcuts available from anywhere in Slack or message shortcuts shown only in message context menus. The shortcuts give you the option to initiate actions from Slack.
- Click Save Changes and install/reinstall the app you created by going to Basic Information and clicking Install to Workspace or Reinstall to Workspace.
3. Create a workflow in Torq
Create a Torq workflow that's triggered by a Slack Interaction Payloads integration.
- Go to Workflows and click Create Workflow.
- Specify a name for your workflow and pick the trigger to be an integration.
- Set the trigger integration type to Slack Interaction Payloads and then select the integration you created.
- Add functionality to the workflow you created.
4. Interact with Slack to trigger the workflow
You'll create a custom block in Slack and set up a Torq workflow.
- Use the Slack Block Kit Builder to create a custom collection of blocks with interactive components.
- Copy the block payload to the Custom Slack Post Message step to send a message containing the interactive components to a channel. Make sure you invite the Slack app to the channel.
- To get the channel ID, right-click the channel name in Slack and select View channel details.
- Go to the OAuth & Permissions tab of your Slack app and copy the Bot User OAuth Token to provide it as the TOKEN parameter.
- When a user interacts with your message the workflow is triggered and the Slack Interaction Payloads trigger will receive the event. Go to the trigger Event Log tab to view it.
Was this article helpful?