Ресурс жеткізушілер тізімі
GET
/api/v1/energies Ресурс жеткізуші компаниялардың иерархиясын қайтарады.
Сұрау параметрлері
page integer Бет нөмірі.
Жауап өрістері
| Атрибут | Сипаттама |
|---|---|
id | Жүйедегі ресурс жеткізушінің идентификаторы (бірегей кілті) |
name | Ресурс жеткізушінің атауы |
children | Филиалдар және/немесе бөлімшелер массиві |
data | Қайтарылатын деректер массиві |
total_pages | Қайтарылатын таңдамадағы беттердің жалпы саны |
current_page | Ағымдағы бет |
next_page | Жүктеуге қолжетімді келесі бет; ағымдағы бет соңғысы болса — null |
Сұрау
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/energies?page=1"js
const res = await fetch('https://api.vadsro.eu/api/v1/energies?page=1', {
headers: {
'access-token': '*********************',
'token-type': 'Bearer',
client: '**********************',
uid: 'api-user@example.com',
'Content-Type': 'application/json',
},
});
const data = await res.json();python
import requests
res = requests.get(
"https://api.vadsro.eu/api/v1/energies",
params={"page": 1},
headers={
"access-token": "*********************",
"token-type": "Bearer",
"client": "**********************",
"uid": "api-user@example.com",
"Content-Type": "application/json",
},
)
data = res.json()go
req, _ := http.NewRequest("GET", "https://api.vadsro.eu/api/v1/energies?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)php
$ch = curl_init("https://api.vadsro.eu/api/v1/energies?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);Жауап
json
{"data":[
{
"id": 1,
"name": "Example Gas Distribution",
"children": [
{ "id": 2, "name": "Example Gas Distribution North", "children": [] },
{ "id": 3, "name": "Example Gas Distribution South", "children": [] }
]
},
...
],
"total_pages": 8,
"current_page": 1,
"next_page": 2
} Соңғы жаңарту
Бұл бет пайдалы болды ма?
Пікіріңіз үшін рақмет!
Ресурс жеткізушілер мен тұтынушылар
Артқа
Тұтынушылар тізімі
Келесі