HTTP Request

The HTTP Request block allows you to make request to any external Rest API. The primary use case for this in chat is to fetch data from a customized external system and also to send collected information out to an external system such as an order update.

How to make a API Request?

  1. Start by selecting extensions in the flow palette on the left in the flow builder

  2. Drag an Add On node on to the flow builder

  3. In the properties add the details of the API you are calling.

    1. You can choose the url or specify a parameter that holds the url

    2. Specify headers, payloads and HTTP method

  4. Save the properties and then connect your node in your flow

How to use the API Response?

When your HTTP Request gets a response back it is available in a parameter called actionOutput. This parameter will contain the response sent by the external system.

To use this you can make use of templating language to access any fields inside the response. For example if this is the response and we wanted to show order details:

API Response

{"order": {"id": 12, "name": "blue tshirt", "price": 10, "count" 1}}

Template

Order Id: {{ actionOutput.order.id }}
Product: {{ actionOutput.order.name }} ${{ actionOutput.order.price }} 
Quantity: {{ actionOutput.order.count }}

The templates can be used in any messages being sent to customers.

Last updated