This topic describes how to configure the HTTP Request component, which sends HTTP requests to a specified URL.
Component information
Icon | Name |
| HTTP Request |
Prerequisites
To configure this component, access the flow canvas by using an existing flow or creating a new one.
Go to the canvas of an existing flow
In the
Create a new flow to open its canvas. For more information, see Create a flow.
Procedure
Click the HTTP Request component icon on the canvas to view its configuration panel on the right.
The configuration panel on the right contains an available variables section with variables such as
incomingMessage,wabaId, andwabaPhoneNumber, and a basic settings section. In the basic settings section, you can configure Request Method (GET by default), Timeout (in seconds), URL (required), and the Failure Branch switch. You can also click Add Request Header and Add Path Parameter to add more options. When finished, click Save in the upper-right corner.Configure the component's parameters as required. For detailed descriptions, see Parameters.
After you finish the configuration, click Save. In the dialog box that appears, click Save.
Parameters
Parameter | Description | Example |
Request Method | The HTTP method for the request. The following methods are supported:
| The basic settings also include the following parameters: Timeout (in seconds), URL (required), and Failure Branch (a switch that is disabled by default). |
Timeout | The amount of time in seconds to wait for a response before the request times out. | |
URL | The endpoint URL that receives the request. | |
Content Type | If you set Content Type to POST, you must specify the Content Type. The following types are supported:
| |
Failure Branch | Toggle this switch to enable a separate branch in the flow to handle failed requests. | |
Request Header Configuration | Configure the following parameters for the request header:
| In Key, enter |
Request Body Configuration | If Request Method is POST, you can configure the request body in one of the following formats: key-value:
raw: Manually enter the content for the request body. For details, see Request body configuration. | When configuring request body parameters, select the key-value mode and set the Key and Value, or select the raw mode and manually enter the content. You can click Insert Variable to add variable values or click Add Body to add more parameters. |
Request Path Configuration | If Request Method is GET, you can configure request path parameters:
| When you configure the URL parameters for a GET request, set Key to |
Response Variable Configuration | Ensure the variable name matches a key in the JSON response object. | In the Response Variable Configuration section, enter a variable name. Click + Add Variable to add more variables, or click the delete icon to remove an existing variable. |
Request body configuration
You can configure the request body in two modes: Key Value and Original Value.
Key Value: This mode is recommended for simple request body structures. For example:
Set the first key-value pair's Key to MyName and Value to haiwei.dhw. For the second pair, set its Key to customerName and Value to the variable {{customerName}}.
If the Content Type is
application/json, the data format is:{"myName": "haiwei.dhw", "customerName": "{{customerName}}"}. If the Content Type isapplication/x-www-form-urlencoded, the data format is:"myName=haiwei.dhw&customerName={{customerName}}".Original Value: This mode is recommended for complex request structures. It allows you to freely edit the entire request body. The content you enter must match the selected Original Value, either
application/jsonorapplication/x-www-form-urlencoded.application/json
If the Content Type is
application/json, the raw request body can be structured as follows:{ "customerNames": [ { "name": "{{customerName}}", "type": "vip", "intentional": true, "intentionLevel": 5 } ], "myName": "haiwei.dhw", "someConplicatedStructure": { "a": { "b": "c" } } }application/x-www-form-urlencoded
If the Content Type is
application/x-www-form-urlencoded, the raw request body can be structured as follows:customerNames[0][name]={{customerName}}&customerNames[0] [type]=vip&customerNames[0] [intentional]=true&customerNames[0] [intentionLevel]=5&myName=haiwei.dhw&someConplicatedStructure[a][b]=c