Create HTTP Data Actions

You can use an HTTP API data action in a workbook so that when you select a column, it sends the value to a REST API which returns a response.

You must configure the domain that you're trying to connect to as a safe domain before you create an HTTP API data action. See Register Safe Domains.

  1. On the Home page, hover over a workbook, click Actions (Actions menu ellipsis icon), then select Open.
  2. Click workbook Menu and then select Data Actions.
  3. Click Add Action and enter a name for the new HTTP API data action. For example, enter HTTP API Example.
  4. Click the Type field and select HTTP API.
  5. Click the Anchor To field and select the columns that you want the HTTP API data action to apply to. Don't select measure columns or hidden columns. If you don't specify a value for the Anchor To field, then the data action applies to all data elements in the visualizations.
  6. In the HTTP Method list select a method.
  7. Enter the URL for the REST API that starts with http or https and optionally includes replacement tokens.
  8. If you selected the POST method:
    • When you select the Payload Type value Form Data, enter each parameter on a separate line.
    • When you select the Payload Type value Raw Data, enter the raw data.
  9. Enter a custom HTTP header if you want to add or override the HTTP header to suit the API that you're interfacing with.
  10. Click Supports Multiple Selection to set the value.
    • On - The data action can be invoked when one or multiple data points are selected.
    • Off - The data action can only be invoked when a single data point is selected.

      This setting is particularly useful when the selection of multiple data points might result in an error (for example, with some third-party REST APIs).

  11. Click OK to save.
  12. Click a data point in the visualization.

    For example, you might select "Books" from a token Category column to display a particular REST API.

  13. Right-click and select HTTP API Example to display the result.

    The selected data-points determine which values to pass to the URL tokens.

    A success or failure message is displayed confirming the REST API has been successfully invoked using the selected value.