Slack interaction payloads
  • 27 Jan 2023
  • 2 Minutes to read
  • Dark
    Light

Slack interaction payloads

  • Dark
    Light

Article Summary

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.

  1. Go to Integrations > Triggers, search for the Slack Interaction Payloads card, and click Add.
  2. Enter a meaningful name for the integration, such as slack-interaction-payloads, and click Add.
  3. 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.

Screenshot showing how to copy the webhook URL of the interaction payloads integration.

2. Subscribe to interactive events and create shortcuts in Slack

Perform these steps in Slack: https://api.slack.com/apps/.

  1. Select an existing app or click Create an App and select the option to configure it From scratch.
  2. Specify a name for your app and select the Slack workspace you want to develop the app in.
  3. Once you've created the app, go to Interactivity & Shortcuts and set Interactivity to On.
  4. Enter the Slack Interaction payloads integration endpoint you created in Torq as the Request URL.Screenshot showing how to configure interaction payloads in Slack.
  5. 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.
  6. Click Save Changes and install/reinstall the app you created by going to Basic Information and clicking Install to Workspace or Reinstall to Workspace.Screenshot showing how to reinstall the app to your the workspace.

3. Create a workflow in Torq

Create a Torq workflow that's triggered by a Slack Interaction Payloads integration.

  1. Go to Workflows and click Create Workflow.
  2. Specify a name for your workflow and pick the trigger to be an integration.
  3. Set the trigger integration type to Slack Interaction Payloads and then select the integration you created.
  4. 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.

  1. Use the Slack Block Kit Builder to create a custom collection of blocks with interactive components.
  2. 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.
    1. To get the channel ID, right-click the channel name in Slack and select View channel details.
    2. Go to the OAuth & Permissions tab of your Slack app and copy the Bot User OAuth Token to provide it as the TOKEN parameter.Screenshot showing how to access and copy the Bot user OAuth token.Screenshot showing how and where to use the Bot user OAuth token in a Torq step.
  3. 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.Screenshot showing the event log for the workflow in Torq.


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.