Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 32 Next »

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}.


FieldDescriptionExample Value
NameName given to the HTTP Node. This will be displayed on the Actionflow canvas.BankHolidays
HTTP MethodThe HTTP method. A drop-down field containing: GET, POST, GET or POST, DELETE, OPTIONS, PUT, PATCH.Get
URL Template

A template that computes the URL of the request.

If using the URL to pass across parameters, care should be taken to ensure that the values are appropriately URL encoded.  

https://www.gov.uk/bank-holidays.json


https://server/phixflow/api/1/action/App/Api/trigger?field=abc

Body Template

Optional.

If this 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 ${in.MyValue}.

//JSON Example
{
    "Industry": "${in.Industry}"
}
Error Expression

Optional.

A JEP expression to determine if the response is an error and if so, send on the Error Output Connection Point. The expression will have access to the input record (in) and the mapped output response (_result).

_result.isError
Log Traffic

Toggle on  to log the response of the HTTP request in the System Console, e.g. see an error returned, or see the output before specifying a path.

Use this when testing but switch off once testing is completed.

Maximum HTTP Log Length

Available if Log Traffic is toggled on .

Restricts the size of the log traffic.

1000
Use Raw URL

Toggle on  to send the URL Template value in exactly the format it is provided to the HTTP Node.

If toggled off PhixFlow will transpose values to form a valid URL, such as replacing spaces with %20.

HTTP ConfigurationSee HTTP Configuration

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 PointDescription
OutContains the resulting record of the request. 
ErrorContains the resulting record of the request where it satisfies the error expression specified on the HTTP Node. 

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
  • statusMessage: The returned status message, for example, OK
  • cookies: Returns an array of cookie name, domain, etc.
  • isError: Returns true if the response contains a 400+ error code
  • headers: Returns an array of header values
  • statusFamily: Returns the status family code, for example if status returns 202, then statusFamily will return 200
  • transmissionError: Returns true if the request failed, e.g. timed out

Connect to a JSON Node or XML Node to the output connection to interpret the 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


Parameters

Parameters are used to transmit values within a URL. They are automatically added to the end of the URL the HTTP action is calling, with the format: ?param1Name=param1Value&param2Name=param2Value

  • The Parameter values are automatically encoded into a format suitable for passing via a URL
  • Refer to attributes mapped into the HTTP action using the syntax: ${ConnectorName.AttributeName} in the Expression
  • The parameter names must match those set on the API

See HTTP Action Configuration for an example.

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.

Retry

Retry allows automatic reattempting of the the HTTP connection under certain conditions, as specified by the Retry Expression. For example:

  • A transmission error or timeout occurs

  • Specific status codes are returned

  • Specific response body or headers are returned

Care should be taken if setting an automatic retry in response to a timeout as it may not always be appropriate, e.g. if the HTTP action causes a job to be started on a target system, receiving a timeout does not mean that the job was not started, therefore retrying (and possibly starting multiple processes or updates on a target system) might be the wrong solution.

Expressions can use _result to access the last response and tracking information. The initial requests will get a partially populated _result record. Using _result allows the action to modify the request, such as to follow redirects or links, or submit a token returned by the previous request.

FieldDescription
Retry Expression

The default is false.

Enter an expression that when it evaluates to true, the connection will be reattempted, instead of continuing through the Actionflow.

When a Retry Expression is entered, the following options are available:
Retry Interval Expression (ms)

The default value is 1000

Enter an expression that when it evaluates to an integer, it determines the amount of time between attempted requests.

Maximum Retries

The default value is 3

This is the maximum number of times the HTTP action will try the HTTP connection before continuing. This must be an integer between 1 and 60.

Description

We recommend that you always enter a description to explain the purpose of this item.

Advanced

FieldDescription
Connection Timeout (s)The maximum time to wait to while attempting to create a connection, measured in seconds. The default for this is set to 300 seconds.
Response Packet Timeout (s)The maximum time to wait between responses from the data packets, measured in seconds. The default for this is set to 180 seconds.
Prioritise throughput over ordering

When this option is ticked records are processed in parallel to optimise performance. This means the order records are processed is nondeterministic.

When unticked (default), records are processed in the order they are provided.

More Options > Run Action

Individual  HTTP action nodes can be run in isolation from the rest of the Actionflow, using the  Run Action option, found under the  More Options menu on the HTTP action's Properties. See Running Actions and Actionflows.

Sections on this page


Learn More

For links to all pages in this topic, see Actionflow Properties

  • No labels