FAQ: how do I return an HTTP response with data from the query string of the request?

To issue an HTTP response with data from the query string of the request:

  1. Create a new workflow.
  2. Choose the HTTP API trigger.
  3. Click the + button below the trigger step, and choose the option to Run Node.js code.
  4. The $.respond function lets you issue an HTTP response. In the body, you’ll want to include the data you’d like to return (you can inspect data in the trigger step and copy the reference to that data). For example, if the incoming data is in the query string parameter name, you can return the value of that query string parameter like so:
$respond({
  status: 200,
  body: steps.trigger.event.query.name
});
1 Like