# Send data using HTTP

{% hint style="info" %}
See the changelog of the **HTTP** Data sink type [here](/data-sinks/http-data-sink.md).
{% endhint %}

## Overview

Onum supports integration with [HTTP](https://developer.mozilla.org/es/docs/Web/HTTP).

HTTP, which stands for Hypertext Transfer Protocol, is a foundational protocol for communication on the World Wide Web. It defines how messages are formatted and transmitted between web servers and browsers, enabling the retrieval and display of webpages and other web content.&#x20;

## Onum Setup

{% stepper %}
{% step %}
Log in to your Onum tenant and click **Data Sinks> New Data sink**.
{% endstep %}

{% step %}
Double-click the **HTTP** Sink.
{% endstep %}

{% step %}
Enter a **Name** for the new Data Sink. Optionally, add a **Description** and some **Tags** to identify the Sink.
{% endstep %}

{% step %}
Decide whether or not to include this Data sink info in the metrics and graphs of the [**Home**](/the-workspace/home.md) area.
{% endstep %}
{% endstepper %}

Click **Finish** when complete. Your new Data sink will appear in the **Data sinks** area list.

## Pipeline configuration

When it comes to using this Data sink in a [Pipeline](https://docs.onum.com/the-workspace/pipelines), you must configure the following output parameters. To do it, simply click the Data sink on the canvas and select **Configuration**.

### Output configuration

{% stepper %}
{% step %}
Add the HTTP Sink to your Pipeline and connect it to a Listener or Action to provide it with data.
{% endstep %}

{% step %}
Double-click the **HTTP** Sink.
{% endstep %}

{% step %}
Enter the **HTTP method**<mark style="color:red;">**\***</mark> used to connect to the server and the **URL**<mark style="color:red;">**\***</mark>  to send HTTP requests.&#x20;

{% hint style="info" %}
This feature supports dynamic URLs allowing you to select an input field to generate it in real-time e.g. `${FieldName}`. To insert a CRC16 value that you have called CRC16Field, the URL would be\
[`http://192.168.1.30:8080/`](http://192.168.1.30:8080/)`\?${CRC16Field}`
{% endhint %}
{% endstep %}

{% step %}
Choose the field containing the **Message** you wish to send on.
{% endstep %}

{% step %}
Set the request **Content type**. Choose between:

* **text/plain** - The message body contains plain text.
* **application/json** - The message body is formatted as JSON. This is the default option.
* **application/xml** - The message body is formatted as XML.
* **text/html** - The message body contains HTML.
* **application/x-ndjson** - The message body is formatted as NDJSON.
  {% endstep %}

{% step %}
Decide whether to **Support Special Characters** and whether to use **Gzip** compression in the request.
{% endstep %}

{% step %}
Map the header key-value pairs to be included in the request.

{% hint style="info" %}
If Authentication or Content-Type settings are set, they will override any headers entered here.
{% endhint %}

You can configure separate header-value pairs for **Field headers** and **Secret Headers**.

**Secret Headers** are intended for carrying sensitive, confidential, or security-critical information. Their values must be protected from unauthorized viewing.
{% endstep %}

{% step %}
HTTP **bulk** configuration refers to setting up an API or system to handle multiple requests or large amounts of data efficiently in a single operation. Instead of sending multiple individual HTTP requests, use the bulk settings to send a single request containing numerous actions.

For example, this sends three user records in one request instead of three separate requests.

```
POST /api/bulk/users HTTP/1.1
Content-Type: application/json

[
  {"id": 1, "name": "Alice"},
  {"id": 2, "name": "Bob"},
  {"id": 3, "name": "Charlie"}
]
```

<table><thead><tr><th width="169.78125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Bulk allow</strong><mark style="color:red;"><strong>*</strong></mark></td><td>Set <strong>true</strong> to set a bulk amount or <strong>false</strong> to ignore.</td></tr><tr><td><strong>Batch Format</strong><mark style="color:red;"><strong>*</strong></mark></td><td><p>Optionally, choose a delimiter to separate the individual records in the bulk data file. Choose between:</p><p></p><ul><li><strong>Manual delimiter</strong> - Each record will appear on its own line. This is the default option. Enter the required delimiter in the <strong>Manual delimiter</strong> field that appears. The default value is <code>\n</code></li><li><strong>Json list</strong> - Use a comma (<code>,</code>) to separate individual JSON objects. </li><li><strong>Stacked JSON Objects</strong> - Each record appears as series of individual JSON objects concatenated together, usually separated by a newline character (<code>\n</code>)</li></ul></td></tr><tr><td><strong>Maximum number of buffers per server URL</strong><mark style="color:red;"><strong>*</strong></mark></td><td>Multiple buffers can be assigned to a single URL to prevent excessive memory usage. The default and maximim value is <code>50</code>.</td></tr><tr><td><strong>Event amount</strong><mark style="color:red;"><strong>*</strong></mark></td><td>Enter the bulk amount to allow through.</td></tr><tr><td><strong>Event time limit</strong><mark style="color:red;"><strong>*</strong></mark></td><td>If the bulk amount is not reached, enter the seconds to wait before sending through the accumulated events.</td></tr></tbody></table>
{% endstep %}

{% step %}
Choose the required **Authentication type**<mark style="color:red;">**\***</mark>:

* **None** - Choose this if no authentication is required.
* **Basic** - Enter the required **Username** and **Password**. Create a [secret](https://docs.onum.com/administration/tenant-menu) containing your password or select one already created.
* **Bearer** - If you're using a bearer **Token**, create a [secret](https://docs.onum.com/administration/tenant-menu) containing it or select one already created.
* **API key** - If you're using API credentials, enter your **API key name** and choose the required **API key value**. Create a [secret](https://docs.onum.com/administration/tenant-menu) containing your API key or select one already created.
* **OAuth2** - Choose if you want to set OAuth2 authentication. Set the following:
  * **OAuth URL**<mark style="color:red;">**\***</mark> - OAuth server URL.
  * **OAuth method**<mark style="color:red;">**\***</mark>**&#x20;-** OAuth method used when sending requests to the server.
  * **Send body as** - Select how to send the request body to the server **From URL encoded** or **JSON**).
  * **OAuth request body** - Body that will be sent to auth server.
  * **OAuth** **token** **path**<mark style="color:red;">**\***</mark> - Path to token in response body from auth server.
  * **Query key / Value pairs** - Set of query keys and values. Use this also in case you are sending the request with **From URL encoded** content type.
  * **Query key / Secret value pairs** - Set of header keys and values that have been saved as [Secrets](/administration/global-settings/organization-settings/secrets-management.md).
    {% endstep %}

{% step %}
Click **New secret** to create a new one:

* Give the secret a **Name**.
* Turn off the **Expiration date** option.
* Click **Add new value** and paste the corresponding value.
* Click **Save**.

<figure><picture><source srcset="/files/NeeWsSQzoChVxRIY76Nt" media="(prefers-color-scheme: dark)"><img src="/files/1oTccyPmgZJ1laY7IhZH" alt=""></picture><figcaption></figcaption></figure>

{% hint style="info" %}
Learn more about secrets in Onum in [this article](/administration/global-settings/organization-settings/secrets-management.md).
{% endhint %}

You can now select the created secrets in the configuration.
{% endstep %}

{% step %}
Activate the **TLS Configuration** toggle to enable TLS and configure these parameters:

* Choose the **Minimum TLS version**<mark style="color:red;">**\***</mark> to use
* Create a [secret](https://docs.onum.com/administration/tenant-menu) containing your TLS **Certificate** or select one already created
* Create a [secret](https://docs.onum.com/administration/tenant-menu) containing your TLS **Private key** or select one already created
* Activate or deactivate **Skip TLS validations**
* Create a [secret](https://docs.onum.com/administration/tenant-menu) containing your **CA Chain** or select one already created.
  {% endstep %}

{% step %}
If your organization uses proxy servers, establish the connection here:

* Choose the field to set in the **Proxy scheme** (**HTTP** or **HTTPS**)
* **Username** used in the proxy
* Create a [secret](https://docs.onum.com/administration/tenant-menu) containing your proxy **Password** or select one already created
* Proxy server **URL** and port.
  {% endstep %}

{% step %}
Set a rate limit on the **Maximum requests** per second to launch on the server. The maximum value is `100`.
{% endstep %}

{% step %}

#### Retry configuration

* **Max attempts -** Maximum number of attempts before returning an error. The minimum value is `1`, and the maximum value is `5`.
* **Wait between attempts -** The milliseconds to wait between retry attempts. The minimum value is `100`, and the maximum value is `1000`.
* **Backoff interval -** A multiplication factor you may apply to the time established in the **Wait between attempts** parameter to increase the time to wait between attempts. For example, if the **Wait between attempts** is `100`, and the **Backoff interval** is `2`, the retry time will increase as follows each time: `100`, `200`, `400`, `800`... The minimum value is `1`, and the maximum value is `5`.
  {% endstep %}
  {% endstepper %}

Click **Save** to save your configuration.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onum.com/the-workspace/data-sinks/data-sink-integrations/send-data-using-http.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
