---
title: Kanali
method: GET
weight: 2
section: 'Basics'
---

import {
  EndpointHeader,
  ParamField,
  ParamFields,
  CodeGroup,
  RequestExample,
  ResponseExample,
} from '@/components/api';

<EndpointHeader method="GET" path="/api/v1/channel_archive_types" />

Vraća po stranicama listu kanala vezanih za tip merila.

<ParamFields title="Parametri upita">
  <ParamField name="equipment_type_id" type="integer">
    Identifikator tipa konfiguracije mernog uređaja za koji se preuzimaju kanali.
  </ParamField>
  <ParamField name="page" type="integer">
    Broj stranice.
  </ParamField>
</ParamFields>

## Polja odgovora

| Atribut                | Opis                                                                                |
| ---------------------- | ----------------------------------------------------------------------------------- |
| `equipment_type_id`    | Identifikator (jedinstveni ključ) tipa konfiguracije mernog uređaja u sistemu       |
| `archive_type_name`    | Naziv tipa arhive                                                                   |
| `archive_type_varname` | Kod tipa arhive                                                                     |
| `telemetry_type_name`  | Naziv tipa telemetrije                                                              |
| `channel_name`         | Naziv kanala                                                                        |
| `channel_varname`      | Kod kanala                                                                          |
| `unit_name`            | Jedinica mere                                                                       |
| `total_pages`          | Ukupan broj stranica u vraćenom skupu                                               |
| `current_page`         | Trenutna stranica                                                                   |
| `next_page`            | Sledeća stranica dostupna za preuzimanje; `null` ako je trenutna stranica poslednja |

<RequestExample>
  <CodeGroup labels={["curl", "Node", "Python", "Go", "PHP"]}>
    <Fragment slot="panel-0">

```bash
curl -i \
  --header "access-token: *********************" \
  --header "token-type: Bearer" \
  --header "client: **********************" \
  --header "uid: api-user@example.com" \
  --header "Content-Type: application/json" \
  --request GET \
  "https://api.vadsro.eu/api/v1/channel_archive_types?equipment_type_id=25&page=1"
```

    </Fragment>
    <Fragment slot="panel-1">

```js
const res = await fetch(
  'https://api.vadsro.eu/api/v1/channel_archive_types?equipment_type_id=25&page=1',
  {
    headers: {
      'access-token': '*********************',
      'token-type': 'Bearer',
      client: '**********************',
      uid: 'api-user@example.com',
      'Content-Type': 'application/json',
    },
  },
);
const data = await res.json();
```

    </Fragment>
    <Fragment slot="panel-2">

```python
import requests

res = requests.get(
    "https://api.vadsro.eu/api/v1/channel_archive_types",
    params={"equipment_type_id": 25, "page": 1},
    headers={
        "access-token": "*********************",
        "token-type": "Bearer",
        "client": "**********************",
        "uid": "api-user@example.com",
        "Content-Type": "application/json",
    },
)
data = res.json()
```

    </Fragment>
    <Fragment slot="panel-3">

```go
req, _ := http.NewRequest("GET", "https://api.vadsro.eu/api/v1/channel_archive_types?equipment_type_id=25&page=1", nil)
req.Header.Set("access-token", "*********************")
req.Header.Set("token-type", "Bearer")
req.Header.Set("client", "**********************")
req.Header.Set("uid", "api-user@example.com")
req.Header.Set("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)
```

    </Fragment>
    <Fragment slot="panel-4">

```php
$ch = curl_init("https://api.vadsro.eu/api/v1/channel_archive_types?equipment_type_id=25&page=1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "access-token: *********************",
    "token-type: Bearer",
    "client: **********************",
    "uid: api-user@example.com",
    "Content-Type: application/json",
]);
$data = json_decode(curl_exec($ch), true);
```

    </Fragment>

  </CodeGroup>
</RequestExample>

<ResponseExample>

```json
{
  "data": [
    {
      "equipment_type_id": 2,
      "archive_type_name": "Daily readings archive",
      "archive_type_varname": "daily",
      "channel_name": "Average pressure",
      "channel_varname": "P",
      "unit_name": "kPa"
    }
  ],
  "total_pages": 4,
  "current_page": 1,
  "next_page": 2
}
```

</ResponseExample>
