Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The HTTP Client collector function collects data from a third-party HTTP server. You can configure this function to set the values for how the HTTP Client function would behave when communicating with the third-party HTTP server, and specify the method of communication.

You can configure this function in the following settings:

Table of Contents
minLevel1
maxLevel1
outlinefalse
styledisc
typelist
printabletrue

Connection

Depending on your configuration, three authentication methods are available: None, Basic authentication and OAuth 2.0.

When you select an Authentication type, there will be separate configuration options for the selected authentication type.

Rw ui tabs macro
Rw tab
titleNone

Add the Target URL of the HTTP request to be made to the HTTP server. You can use Variable Insertion.

Note

Note!

Usage Engine Cloud Edition interprets only a single forward slash in the URL fields. Ensure that you format the URLs accordingly. 

Rw tab
titleBasic authentication

Add the Username and Password if there are any. These options are optional.

Add the Target URL of the HTTP request to be made to the HTTP server. You can use Variable Insertion.

Note

Note!

Usage Engine Cloud Edition interprets only a single forward slash in the URL fields. Ensure that you format the URLs accordingly. 

Rw tab
titleOAuth 2.0

Add the Target URL of the HTTP request to be made to the HTTP server. You can use Variable Insertion.

Check the Use redirect fields check box to enable URL redirection using the available options. Two fields are displayed when this option is enabled – the Target URL field where the designated address is to be entered, and an optional Resource path.

Note

Note!

Usage Engine Cloud Edition interprets only a single forward slash in the URL fields. Ensure that you format the URLs accordingly. 

Note

Note!

When the Authentication type selection is selected as OAuth 2.0, additional options are displayed. See the OAuth2.0 credentials and OAuth2.0 parameters sections for more information. Their configuration is mandatory to properly activate the function. 

Rw ui expands macro
Rw expand
titleOAuth2.0 credentials

When the OAuth 2.0 authentication type is selected in the Connection section, it is possible to enable Secrets Wallet to apply stored credentials. 

If Secrets Wallet is not enabled, you configure the following fields.

  • Grant type – Select the grant type of the credential. There are two grant types, Password credentials and Client credentials.

  • Client ID – Enter the client identifier. This field is mandatory.

  • Client secret – Enter the associated client secret. This field is mandatory. This parameter may be omitted if the client secret is an empty string. 

  • Username – Specify the relevant username. This field is mandatory. This field appears when Password credentials is selected for the Grant type.

  • Password – Specify the password associated with the username. This field is mandatory. This field appears when Password credentials is selected for the Grant type.

Rw ui expands macro
Rw expand
titleOAuth 2.0 parameters

The OAuth 2.0 parameters section of the function controls the authentication token credentials.

If Secrets wallet is not enabled in the OAuth 2.0 credentials section, the following options are for either Password credentials or Client credentials are selected as the Grant Type:

  • Access token URL – Specify the URL containing the authorization token. 

  • Token header prefix – The authorization header placed before the access token.

  • Scope – The authorization and token endpoints allow you to specify the access request scope using this parameter. The entered value must be expressed as a list of space-delimited, case-sensitive strings. This is an optional parameter.

  • Audience - Set the recipient that the token is intended for.

  • Client authentication – This option controls the type of authentication mechanism as defined by the connecting server – Auth Header or Auth Body are available. The options are named "Send as basic auth header" and "Send client credentials in body".

If Secrets wallet is enabled in the OAuth 2.0 credentials section, and the Private key JWT authentication type is selected, there are distinctive configuration options:

  • Access token URL – Specify the URL containing the authorization token. 

  • Token header prefix – The authorization header placed before the access token.

  • Issuer – Set the issuer of the JWT

  • Audience – Set the recipient that the JWT is intended for.

  • Subject – Set the subject of the JWT, typically representing the user or entity the token is about.

  • Identifier – Set a unique identifier for the JWT.

  • Add claim – List the permissions that the application requests. When you click the Add claim button, you enter the Key and Value of the permission.

If Secrets wallet is enabled in the OAuth 2.0 credentials section, and the Bearer token authentication type is selected, there are distinctive configuration options.

  • Token header prefix – The authorization header placed before the access token.

  • Scope – The authorization and token endpoints allow the client to specify the access request scope using this parameter. The entered value must be expressed as a list of space-delimited, case-sensitive strings. This is an optional parameter.

  • Audience - Set the recipient that the token is intended for. This is an optional parameter.

  • Client authentication – This option controls the type of authentication mechanism as defined by the connecting server – Auth Header or Auth Body are available. The options are named "Send as basic auth header" and "Send client credentials in body".

Operational settings

In Operational settings, enter the following details that determine how you want the function to behave.

In Request run limit, specify the number of times the operation should run in a single stream. The limit of runs you can request is from one to 12.

In Action on error, specify the action you want to take in case of an error. You can select from the following options:

Action on error options

Description

Ignore

Select to ignore the error and the stream keeps on running.

Stop the stream

Select to stop the stream.

Any response with the HTTP status code 4xx or 5xx is considered an error. All errors get logged in the system logs. See Logs for more information.

The default value is Ignore.

General settings

In General settings, you select an HTTP request method from the following options:

HTTP Method

Description

GET

Request data from the target server.

POST

Sends data to the target server. Select either Body or Form under Contents*.

PUT

Replaces the current resources of the target URL with the uploaded content. Select either Body or Form under Contents*.

PATCH

Updates partial resources of the target URL. Select either Body or Form under Contents*.

DELETE

Removes all current representations of the target resource.

Note

Note!

*The Body and Form fields are visible only for the POST, PUT and PATCH request methods. See Contents for more information.

You can select a combination of the following options to be included:

Option

Description

Include query string in URL

Select to include a query string in the URL. Add a Key and its corresponding Value. You can include multiple query strings.

Customize header

Select to customize the headers of the URL and specify multiple keys and their respective values.

The default value for the HTTP headers “content-type” and “accept” is application/json.

You can override the default value for the HTTP header “content-type.”

It is recommended that the default value for the HTTP header “accept” is left unchanged. The HTTP functions only support application/json.

Rw ui expands macro
Rw expand
titleContents

Select Body or Form and add the corresponding details in the content of the request message. You can use Variable Insertion.

Note

Note!

The form input needs to be URL encoded, otherwise, it fails.

HTTP requests use a hardcoded content-type value of ‘application/x-www-form-urlencoded’. 

Expand the examples below to view samples of HTTP request messages for Body or Form:

Expand
titleSample of an HTTP body content message


No Format
{
"name" : "my_username",
"first-name" : "My",
"last-name" : "Username",
"display-name" : "My Username",
"email" : "user@example.test",
"active" : true
}


Expand
titleSample of an HTTP form content message


No Format
name=my_username&first-name=My&last-name=Username&display-name=My%20Username&email=user@example.test&active=true


Results

In Result key, you can assign a name to the result that you receive in response to the request. It is recommended to configure the resulting key to make future references of the same response easy and traceable. The default value is httpResponse.

The support for response headers can be enabled by toggling on the Enable response headers option.A default value for the Result headers Key will be added by the engine (httpResponseHeaders) which will match the placeholder for the key input.

Note

HTTP Response Headers Support

By enabling response headers, the overall data size of the HTTP packets will also increase. Caching of the body check box is tied to the headers. 

This option is available only for the collector and the processor functions.

Info

Token Renewal Support

The collector and processor functions support token renewal, if the servers return a 401 Token Expiry error.