REST API Call - Data360_DQ+ - Latest

Data360 DQ+ Help

Product type
Software
Portfolio
Verify
Product family
Data360
Product
Data360 DQ+
Version
Latest
Language
English
Product name
Data360 DQ+
Title
Data360 DQ+ Help
Copyright
2024
First publish date
2016
ft:lastEdition
2024-07-09
ft:lastPublication
2024-07-09T15:09:58.774265

The REST API Call node allows a REST service to be read from or written to, making a REST call for each input record that is fed to it. This node is appropriate only for cases where the data returned/updated by each REST call is a few thousands records or less; it is not appropriate for cases where the data returned/updated by each REST call is in the tens of thousands of records or higher. Additionally, this node does not support file input/output (upload/download) to HTTP calls.

Note: To form a JSON request body or to parse a JSON response, use the JSON.parse and JSON.stringify Javascript methods of a Script node, which you put before or after this node. For more information, see Script.

Request tab

This tab is used to define your request to the REST service. It contains the following parameters.

URL

The URL to the REST service.

You can use the ${} syntax to provide a reference to field values or other parameters . For more information, see Value substitution.

HTTP Method

The HTTP method to use. Options include: GET, PUT, POST, DELETE, and HEAD.

Authentication

The authentication type. Choose from:

  • None
  • Basic
  • Digest
  • AWS

If required, a username and password can also be specified.

If you select AWS, you can also provide an Access Key, Secret Key, and the AWS Service Name.

Call Type

Call Type

Description

Simple

For basic calls that do not require paging.

Paging Call using Request Parameter

A paging call where a request parameter provides the offset or page number.

Paging Call using Response Marker

A paging call where there is a marker in the response that should be passed in to the next request.

Paging Variable Settings

If paging using a Request Parameter, Paging Variable Settings may be used to define a Name, Initial Value, and Increment Value. The Name specified must then be included in the URL or Request Body of the call as a substitutable variable using the ${} syntax.

If paging using a Response Marker, Paging Variable Settings may be used to define a Name. The Name specified must then be included in the URL or Request Body of the call as a substitutable variable using the ${} syntax. This variable is used to substitute in the value of the marker in the response. For more information, see Value substitution

Request Headers tab

This tab allows you to create a list of name/value pairs for the headers to pass to the REST service with each call. The value of a header can contain field value references using the ${} syntax. For more information, see Value substitution.

Request Body tab

If the HTTP Method selected in the Request tab is of a type that takes a body, this tab will become enabled.

Use this tab to define the following properties:

Content Type

The content type of the request body.

The default value is application/json.

Body

This is a text area that lets you enter text for a body.

The body can contain field value references using the ${} syntax. For more information, see Value substitution.

Response tab

This tab allows you to name the fields that will accept the contents of the response to the REST call.

Status Field Name

The name of the output field in which to return the response status.

The type of this field is integer.

Body Field Name

The name of the output field in which to return the response body if there is one.

The type of this field is string.

Content Type Field Name

The name of the output field in which to return the content type of the response if there is a response body.

The type of this field is string.

Edit Paging Script

If either of the Paging Call Types is in use, an Edit Paging Script button is enabled in the Response Tab. This button allows you to create a script to control paging.

This script is passed an input object called input that contains a string field called response, which contains the response from the REST call. The script is also passed an output object called output that contains a boolean field called continueIteration, an integer field called maxIterations, and a string field called nextMarker. After script execution, if the continueIteration flag is set, then the node does the following:

  • For the Response Marker Call Type, if the nextMarker value is set, another REST call is executed with the restMarker. The response of this new call is then passed into the script for further evaluation and the cycle continues until continueIteration or nextMarker is not set by the script.
  • For the Request Parameter Call Type, if the maxIterations value is > 0, the system will perform as many calls as specified in maxIterations. with the paging variable incremented for each call. The script is not evaluated again. Note that maxIterations is inclusive of the call whose response is being processed.
  • For the Request Parameter Call Type, if maxIterations is <=0 or not set, the system will increment the paging variable and execute another REST call. The response of this new call is then passed into the script for further evaluation and the cycle continues until continueIteration is not set by the script.

The script can use the JSON.parse Javascript function to parse the response string that is sent in.

Additionally, the script editor is prepopulated with the script required to process paginated responses from Govern REST calls when the Call Type is Request Parameter.

Proxy tab

This tab allows you to enable a proxy configuration.

It contains the following parameters.

URL

The url to the proxy server.

The URL can contain field value references using the ${} syntax.

Authentication

The authentication type.

Choose from the available options:None, Basic or Digest.

If you select Basic or Digest, you can also specify a Username and Password.

Value substitution

You can use the ${} syntax in the REST API Call node to substitute values in the URL and request body.

For example, if you have a field in your incoming data set called uid, you can specify the following URL:

https://example.data3sixty.com/api/v2/assets/${uid}

For each incoming record, the value found in the uid field is used for the REST API call for the record.

You can use this syntax to substitute Environment properties, execution parameters, and field values. If there is a conflict caused by more than one of propert, parameter, or value sharing the same name, the following order of precedence determines which value is substituted:

  1. Execution Parameters
  2. Environment Properties
  3. Fields

For example, if an execution parameter and an environment property have the same name, the value of the execution parameter is used. This means that if you have defined an environment property or field name that is the same as a Data360 DQ+ system execution parameter, the system execution parameter is used. Data360 DQ+ uses the following system execution parameters:

  • workId, processId
  • refStartTime, refStartTimeYear, refStartTimeMonth, refStartTimeDate
  • refEndTime, refEndTimeYear, refEndTimeMonth, refEndTimeDate
  • now, year, month, date
  • trigger
  • resultCode, resultDetail, resultType