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.
Create a Slack Interaction Payloads Integration in Torq
Perform these steps in Torq.
Go to Build > Integrations > Triggers > Slack Interaction Payloads, 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 created and copy the endpoint URL. You will enter this as the Request URL when subscribing to Slack interactive events.
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.
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 receives the event. Go to the trigger Event Log tab to view it.