# REST V1 (Deprecated)

{% hint style="warning" %}
The **REST V1** is deprecated and no longer updated. Please refer to the document with the most recent version of the feature: [REST V2](https://docs.digibee.com/documentation/connectors-and-triggers/connectors/web-protocols/rest-v2).&#x20;
{% endhint %}

**REST V2** makes calls to REST endpoints from a pipeline.

## Parameters

Take a look at the configuration options for the component. Parameters supported by [Double Braces expressions](https://docs.digibee.com/documentation/connectors-and-triggers/double-braces/overview) are marked with (DB).

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Description</th><th>Default Value</th><th>Data Type</th></tr></thead><tbody><tr><td><strong>URL</strong></td><td>URL to be called - it may contain parameters following the {:param1} pattern, which will be replaced by the corresponding input message property.</td><td></td><td>String</td></tr><tr><td><strong>Content Type</strong></td><td>Configures the Content Type and encoding.</td><td></td><td>String</td></tr><tr><td><strong>Verb</strong></td><td>REST call type (GET, POST, and PUT).</td><td></td><td>String</td></tr><tr><td><strong>Account</strong></td><td>Account to be used by the component.</td><td></td><td>String</td></tr><tr><td><strong>Connection Timeout</strong></td><td>Connection expiration time (in milliseconds).</td><td></td><td>Integer</td></tr><tr><td><strong>Reading Timeout</strong></td><td>Maximum time for reading (in milliseconds).</td><td></td><td>Integer</td></tr><tr><td><strong>Stop On Client Error</strong></td><td>If activated, the option will generate an error and suspend the pipeline execution.</td><td>False</td><td>Boolean</td></tr><tr><td><strong>Stop On Server Error</strong></td><td>If activated, the option will generate an error and suspend the pipeline execution.</td><td>False</td><td>Boolean</td></tr><tr><td><strong>Advanced Settings</strong></td><td>Advanced configurations.</td><td></td><td>Object/Map</td></tr><tr><td><strong>Inject JWT</strong></td><td>If activated, the option inserts the present JWT into the pipeline call (whether generated by the <em><strong>JWT</strong></em> component or not) in the Authorization header of the REST call.</td><td>False</td><td>Boolean</td></tr><tr><td><strong>Read JWT</strong></td><td>If activated, the option puts as return the JWT that is in the internal header Authorization, if it exists.</td><td>False</td><td>Boolean</td></tr><tr><td><strong>Raw Mode</strong></td><td>If activated, the option receives or passes a payload without being JSON.</td><td>False</td><td>Boolean</td></tr><tr><td><strong>Allow Insecure Calls To HTTPS Endpoints</strong></td><td>When activated, the option allows non-reliable calls to HTTPS endpoints to be made.</td><td>False</td><td>Boolean</td></tr><tr><td><strong>Enable Retries</strong></td><td>When activated, the option allows new tries.</td><td>False</td><td>Boolean</td></tr><tr><td><strong>Maximum Number Of Retries Before Giving Up</strong></td><td>Maximum number of retries before giving up the call.</td><td>3</td><td>Integer</td></tr><tr><td><strong>Time To Wait Before Each Retry</strong></td><td>Maximum time between retries (in milliseconds).</td><td>1000</td><td>Integer</td></tr><tr><td><strong>Compress Body With GZIP</strong></td><td>When activated, the option allows the body to be compressed with GZIP.</td><td>False</td><td>Boolean</td></tr></tbody></table>

### Path Parameter

**Example**

<http://test.com/order/$EXPAND{:id,}> &#x20;

### Query Parameter <a href="#query-parameter" id="query-parameter"></a>

**Example**

<http://test.com/order$QUERY{page=:page,search=:search}\r\n\t\t\t>

## Messages flow <a href="#messages-flow" id="messages-flow"></a>

### Input <a href="#input" id="input"></a>

application/x-www-form-urlencoded

```
{
	header: {
		"headerA":"valueA",
		"headerB":"valueB"
	},
		url: {
		"urlParam1": "paramValue"
	},
	formData: {
		"field1": "value1",
		"field2": "value2"
	}
}
```

multipart/form-data

```
{
	header: {
		"headerA":"valueA",
		"headerB":"valueB"
	},
	url: {
		
	},
	multiPartData: {
		"files": {
		"file_formName" "filename",
		"files_formName[]" ["filename1","filename2"]
	},	"fields": {
		"field1" : "value1",
		"field2" : "value2",
	}
	}
}
```

The component waits for a message in the following format:

```
{
	header: {
	"headerA":"valueA",
	"headerB":"valueB"
	},
	url: {
	"urlParam1": "paramValue"
	},
	body: {
	// message to be sent to the endpoint
	}
}

```

&#x20;    &#x20;

### Output <a href="#output" id="output"></a>

* Successful

```
{
    status: XXX,
    body: {},
    headers: {}
}
```

* With error

```
{
    error: "error message",
    code: XXX,
    body: {},
    headers: {} 
}
```

{% hint style="info" %}
In case of some errors, the body and headers will not be available.
{% endhint %}
