# Accessing Data from the API Request

This article explains how you can access tracked data from the JENTIS HTTP API in our platform. You will need access to your JENTIS Platform.

The main difference between tracking on your website and the JENTIS HTTP API is that the API has no direct connection to JENTIS and only sends information to our servers. Therefore, accessing and using this information in variables requires a different approach.

There are two possible approaches to this: creating a client-side variable or a server-side one. Please choose the one that best fits your needs:

## Approach 1: Client-Side Variable

On web tracking, Client-Side Variables extract information from the browser using JavaScript functions.

{% hint style="warning" %}
Remember: The JENTIS HTTP API has no direct connection to the JENTIS Platform. Therefore, we can’t use Client-Side variables like we use on the website, but we can use them as placeholders.
{% endhint %}

On the JENTIS Platform, you can create a new variable by accessing **Server Tag Manager > Add New Variable > Client Side Javascript Code**. We recommend naming these variables with a prefix such as `http_api_<name_of_variable>`.

Once you type the variable name, the ID will be generated automatically. Please use this generated ID for the `variables` - Section of the JENTIS HTTP API Request. The JENTIS Platform will automatically assign the pushed value to the corresponding variable by pushing a dataset with this ID as the key.

### Example

The following data is send through the JENTIS HTTP API:

```javascript
...
 "variables": {
      "jtspushedcommands": ["api-order-mobile-pay", "submit"],
      "order_status" : "cancelled",
      "document_title": "Order Confirmation",
      "document_location_href": "https://www.test.co/",
      "order_brutto": "250.00",
      "order_id": "ORDERID",
      ...
...
```

Next, to access the value of the property `order_status`, create a client-side variable:

<figure><img src="/files/qNZVAyKBLRpHJHVT0tbZ" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The scope should be fixed to **“Event**”

The JavaScript code can be left as generated by the JENTIS System.
{% endhint %}

Using this client-side variable in server-side tags will automatically retrieve the value from the data pushed by the JENTIS HTTP API and resolved to **“cancelled”** for this example.

## Approach 2: Server-Side Variable

If you prefer not to use the previous approach, which involves creating client-side variables as placeholders to extract information from the JENTIS HTTP API, we offer an alternative option of creating a server-side variable.\
\
To access the JENTIS HTTP API variable property with server-side variables, we provide a template variable that allows direct access to a key in the variables section of the request.

The template variable can be found in the JENTIS Platform under **Server Tag Manager > Add New Variable > Server Side**, and by selecting the template **“HTTP API Property”**.

### Example

The following data is pushed to the JENTIS App SDK data layer:

```javascript
...
 "variables": {
      "jtspushedcommands": ["api-order-mobile-pay", "submit"],
      "order_status" : "cancelled",
      "document_title": "Order Confirmation",
      "document_location_href": "https://www.test.co/",
      "order_brutto": "250.00",
      "order_id": "ORDERID",
      ...
...
```

Next, to access the value of the property `order_status`, create a server-side variable using the template **“HTTP API Property”**:

<figure><img src="/files/ydGAFx2i4f6xeYrJxLTT" alt=""><figcaption></figcaption></figure>

By using this server-side variable in server-side tags, the value will automatically be retrieved from the data pushed by the JENTIS HTTP API and resolved to **“cancelled”** for this example.


---

# 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.jentis.com/http-api-tracking/accessing-data-from-the-api-request.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.
