HTTP Action
- Zoe Baldwin
- Anthony George
Overview
Use a HTTP to make HTTPS requests to external APIs;
Properties Tab
Basic Settings
Expects literal values or expressions encapsulated within ${} syntax, for example ${in.MyValue}
.
Field | Description | Example Value |
---|---|---|
Name | Name given to the HTTP Node. This will be displayed on the actionflow canvas. | BankHolidays |
HTTP Method | The HTTP method. A drop-down field containing: GET, POST, GET or POST, HEAD, PUT, DELETE, other. If other is specified a text box will allow the entering of a custom value which is not empty and contains only uppercase letters. | Get |
URL Template | A template that computes the URL of the request. Expects literal values or expressions encapsulated within ${} syntax, for example | https://www.gov.uk/bank-holidays.json |
Body Template | The body is optional for an HTTP message but if it is provided then it is used to carry the HTTP request data. If a body is provided then usually Content-Type and Content-Length headers lines specify the nature of the body associated. In PhixFlow if this evaluates to whitespace only then it is not included in the request. The body expects literal values, or expressions encapsulated within ${} syntax, for example | |
Error Expression | An optional JEP expression to determine if the response is an error and so sent on the error output. The expression will have access to the input record (in) and the mapped output response (_result). | |
Log Traffic | Logs the response of the HTTP request. | |
Maximum HTTP Log Length | Restricts the size of the log traffic. | |
Use Raw URL | If enabled the URL Template value is sent in exactly the format it is provided to the HTTP Node. If not enabled PhixFlow will transpose values to form a valid URL, such as replacing spaces with %20. |
Input Connection Points
Can Accept a single Driving input connection point.
The grid contains a list of all input connection points and their type.
- To add a new input connection point, in the section toolbar click Add New to open a new input connection point and set its properties; see Input Connection Points.
- To edit an existing input connection point, double-click it in the list to open its properties.
- To remove an input connection point, select one and in the section toolbar click Delete.
Output Connection Points
The grid contains a list of output connection points, by default this will be out and error.
Output Connection Point | Description |
---|---|
Out | Contains the resulting record of the request. |
Error | Contains the resulting record of the request where it satisfies the error expression specified on the HTTP Node. |
Adding and Editing
- To add a new output path, in the section toolbar click Add New to open a new output path and set the expression; see Output Connection Points.
- To edit an existing output path, double-click it in the list to open its properties.
- To remove an output path, select one and in the section toolbar click Delete.
Configuration
The configuration of each output connection point is identical:
Field | Description | Example |
---|---|---|
Name | Name of the output | out |
Output Type | A drop-down field containing: String, Raw Data, JSON. | String |
Skip Invalid Records | Skip attributes which are considered invalid. | enabled |
Default Charset | A drop-down field containing character set options including utf-8. | utf-8 |
Path | The JSON path to apply. If empty this will default to '$' which matches the entire object. | // $ returns everything, this syntax traverses down two levels using two full // stops.
|
JSON Lenient | When enabled this removes JSON specification restrictions, allowing for a degree of leniency in malformed JSON data. When disabled the JSON will be treated strictly. | enabled |
Attributes | Contains the attributes which hold the values returned by the Output Connection Point. Result values are obtained using the keyword _result followed by the attribute name. | _result.status |
Output Record
An HTTP Node has two output connection points out
and error
. An HTTP Node is triggered for each input record and will generate one output record which will be sent on either the out or error output.
The resulting record contains the attributes specified by the output connection point, successful records are passed down the out
connection point and records containing an error
are passed down the error connection point. The stricture of the records by default is as follows:
body: The content returned by a successful request. For example, JSON content.
- contentType: The type of response provided by the target HTTP request. For example,
application/json; charset=utf-8
. status: the returned status code.For example,
200
.status message: the returns status message. For example,
OK
.
Connect to a JSON Action to the output connection to interpret the JSON response into individual records.
Headers
Are typically used to specify information for the request such as character sets, session tokens or passwords. Headers can make use of the Secret Key Details see below. For more information see HTTP Header.
For example,
- Name:
Content-Type
- Value:
text/xml; charset=UTF-8
Secret Key Details
Secret Keys allow sensitive data such as passwords or security tokens to be encrypted and stored in the PhixFlow Database.
Secret keys have a name which they can be referenced by using the syntax ${_datasource.keyName}
. For full details on secret keys see Secret Key and Local Secret.
Learn More
- Understanding Actionflows
- Creating Actionflows
- Wiring Actionflows
- Authenticating for an API
- Secret Key and Local Secret
For links to all pages in this topic, see Understanding Actionflows.