# Reports

## Reports

<mark style="color:blue;">`GET`</mark> `http://YOUR_SITE.petroline.ua/index.php?r=terminals/API&type=report`

#### Path Parameters

| Name     | Type   | Description                                                                               |
| -------- | ------ | ----------------------------------------------------------------------------------------- |
| dateFrom | string | Дата начала выборки транзакций. Формат даты dd-mm-yyyy  (25-07-2017).                     |
| dateTo   | string | Дата конца выборки транзакций. Формат даты dd-mm-yyyy (30-07-2019).                       |
| hashkey  | string | хэш-ключ для авторизации запроса - пароль администратора зашифровано в md5(md5(password)) |

#### Query Parameters

| Name   | Type   | Description                                                                                                                |
| ------ | ------ | -------------------------------------------------------------------------------------------------------------------------- |
| card   | string | Фильтр для поиска по карте/картам. Выборка происходит из всех карт, которые подходят под указанный шаблон поиска.          |
| fuel   | string | Фильтра для поиска по типу топлива. Выборка происходит из всех операций, где топливо подходит под указанный шаблон поиска. |
| driver | string | Фильтра для поиска по конкретному названию                                                                                 |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    dateFrom: "25-07-2017",
    dateTo: "25-07-2017",
    count: 2,
    report: [
        {
            id: 7952,
            date: "2017-07-25 07:46:03",
            card_id: 24,
            card: "0030006FEDC9",
            terminal_id: 1,
            terminal: "Терминал-1",
            driver: "Порт",
            car_card_id: null,
            car_card: null,
            car: null,
            cat: null,
            org: "PL-Test",
            fuel_id: 1,
            fuel: "ДТ",
            volume: 100
        },
        {
            id: 7953,
            date: "2017-07-25 07:51:41",
            card_id: 16,
            card: "00300070046A",
            terminal_id: 1,
            terminal: "Терминал-1",
            driver: "Малін",
            car_card_id: null,
            car_card: null,
            car: null,
            cat: null,
            org: "PL-Test",
            fuel_id: 1,
            fuel: "ДТ",
            volume: 100
        },
    ]
}
```

{% endtab %}

{% tab title="400 Не указаны или указаны не верные параметры запроса" %}

```javascript
{
    status: 400,
    message: "Please set FROM date!"
}
```

{% endtab %}

{% tab title="401 Указан не верный hashkey" %}

```javascript
{
    tip: "Add help variable to address string to see help ex: r=terminals/API&help",
    status: 401,
    message: "Unauthorized!"
}
```

{% endtab %}
{% endtabs %}

#### Возвращаемые параметры

* count - общее количество результирующих объектов (операций заправок).
* message - результирующий ответ, индикатором верного ответа является "**ОК**", иначе - ошибка.
* id - уникальный идентификатор транзакции (id)
* date - время совершения операции (заправки).
* card\_id - уникальный идентификатор карты №1 (id).
* card - RFID номер карты №1.
* terminal\_id -  уникальный идентификатор терминала-колонки (id).
* terminal - название терминала-колонки.
* driver - имя/название водителя (иногда транспортного средства) по карте №1.
* car -  имя/название водителя по карте №2.
* car\_card - RFID номер карты №2.
* car\_card\_id - уникальный идентификатор карты №2 (id).
* fuel - название топлива.
* fuel\_id - уникальный идентификатор топлива (id).
* volume - объем топлива в мл.


---

# 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://api.petroline.net.ua/reports.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.
