# Rest Webservice

**Category:** Web

**Version:** 1.0

**Last updated:** November 19, 2025

**Author:** Any2Info

***

### Description

The **REST API Node** allows direct communication with any RESTful web service from within the Data Hub.

It supports all common HTTP methods (**GET**, **POST**, **PUT**, **PATCH**, **DELETE**) and multiple body formats including **JSON**, **form-data**, and **binary**.

***

### Configuration Options

| Setting        | Type    | Required | Description                                                                                                                                                       |
| -------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Connection** | Select  | No       | (Optional) Select an existing connection, e.g., OAuth 2.0 or API key connection.                                                                                  |
| **Body type**  | Select  | Yes      | Defines the format of the request body:• JSON (default)• Form-data• Form-urlencoded• Binary                                                                       |
| **Rate limit** | Numeric | No       | Maximum number of requests per minute to prevent API throttling.                                                                                                  |
| **Execute**    | Select  | Yes      | Defines when and how the call is executed:• Once – execute once.• For Each Row – execute once per incoming row.• For Each Group – execute once per group of rows. |
| **Advanced**   | Button  | Yes      | Opens the configuration window for endpoint details, headers, parameters, and output behavior.                                                                    |

***

### Execute Modes & Placeholders

When **Execute** is set to *For Each Row* or *For Each Group*, placeholders can dynamically insert input data into the endpoint or request body.

Use the toolbar buttons:

* **Endpoint parameter** → inserts a placeholder into the URL
* **Body parameter** → inserts a placeholder into the body

**Example:**

```
<https://api.example.com/orders/{OrderId}>

```

→ `{OrderId}` will automatically be replaced by the value from the input column *OrderId*.

***

### Advanced Configuration

The **Advanced** configuration window provides multiple tabs to define the REST request and response.

#### Tabs Overview

1. Endpoint
2. Parameters
3. Headers
4. Request body
5. Response body
6. Preview
7. Columns

***

#### Endpoint

Define the full API endpoint and select the HTTP method.

Query parameters can be included directly in the URL or configured via the **Parameters** tab.

**Example:**

```
GET <https://api.example.com/orders?Page=1&Size=200>

```

***

#### Parameters Tab

Used to define query parameters.

| Column          | Description                                                                                                                                                   |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name**        | The parameter name (e.g., Page, Size, Filter).                                                                                                                |
| **Type**        | Determines the parameter behavior:• Request – normal query parameter.• Take – number of items per page.• Skip – number of items to skip.• Page – page number. |
| **Value**       | Static value or expression (can include placeholders).                                                                                                        |
| **Description** | Explanation of the parameter purpose.                                                                                                                         |

#### Paging

When the parameter type is *Take*, *Skip*, or *Page*, the node automatically performs paging:

* For endpoints using **Top/Offset**, use *Take* and *Skip*.
* For endpoints using **Size/PageNo**, use *Take* and *Page*.

The node automatically adjusts *Skip* or *Page* values until all data is retrieved.

***

#### Headers Tab

Define custom HTTP headers such as:

| Header                          | Description              |
| ------------------------------- | ------------------------ |
| `Authorization: Bearer {token}` | Adds authentication.     |
| `x-api-key`                     | Adds API key for access. |

Headers can include static values or dynamic placeholders from input columns.

***

#### Request Body Tab

Used for requests that send data (**POST**, **PUT**, **PATCH**).

Supports different formats depending on **Body type**.

* Enter raw JSON or form-data.
* Add placeholders to dynamically insert input values.

***

#### Response Body Tab

Optionally, paste a **sample API response** here for testing or schema definition.

When using **Test mode**, this sample response is used instead of executing the live API call — useful for **POST**, **PATCH**, or **DELETE** actions to prevent data changes.

***

#### Preview Tab

Displays a preview of the node’s output.

Use the **Output mode** dropdown to control how the response is parsed.

| Mode             | Description                                                                |
| ---------------- | -------------------------------------------------------------------------- |
| **Raw**          | Shows StatusCode, StatusDescription, and raw response content.             |
| **JSON**         | Parses the JSON response into a readable structure.                        |
| **JSON → Table** | Converts JSON to a structured table (properties = columns, arrays = rows). |

A **JSONPath** field allows you to filter or extract specific data from the response.

(JSONPath works similarly to XPath for XML.)

**Example JSONPath:**

```
$.orders[*]

```

You can click on column headers in the Preview to select which columns to include in the final output.

***

#### Columns Tab

Lists all columns selected in the Preview.

You can rename or remove columns to define the final output schema.

***

### Call & Test Buttons

| Button   | Description                                                                            |
| -------- | -------------------------------------------------------------------------------------- |
| **Call** | Executes the live API request and populates the Preview with real data.                |
| **Test** | Uses the sample response from the *Response Body* tab instead of calling the live API. |

***

### Input / Output

| Direction  | Type  | Description                                                                            |
| ---------- | ----- | -------------------------------------------------------------------------------------- |
| **Input**  | Table | Data rows used to construct dynamic endpoints or request bodies.                       |
| **Output** | Table | Table containing HTTP status and response data. Structure depends on Preview settings. |

***

### Tips & Best Practices

* For **POST/DELETE** requests, prefer **Test mode** with a sample response to avoid altering data.
* Enable **paging parameters** (*Take*, *Skip*, *Page*) to automatically handle large datasets.

***

### Errors & Troubleshooting

| Error Message        | Meaning                                | Solution                                |
| -------------------- | -------------------------------------- | --------------------------------------- |
| **401 Unauthorized** | Invalid or expired credentials.        | Verify the connection or API key.       |
| **404 Not Found**    | The specified endpoint does not exist. | Check endpoint path and spelling.       |
| **400 Bad Request**  | Invalid or incomplete request payload. | Validate JSON body and required fields. |

***

### Changelog

| Version | Date              | Change                               |
| ------- | ----------------- | ------------------------------------ |
| **1.0** | November 19, 2025 | Initial documentation version added. |
