Довідники
Методи, які лише читають: звідки взяти team_id, cloudflare_id, filter_account_id і filter_stream_id для створення PWA, сплітів і доменів. Перевірити сам ключ і дізнатися, чий він, можна запитом профілю - див. «Вступ до API».
| Метод | Адреса | Що робить |
|---|---|---|
| GET | /teams | Ваші команди |
| GET | /cloudflares | Акаунти Cloudflare |
| GET | /filter_accounts | Акаунти фільтрації |
| GET | /filter_accounts/{id}/streams | Потоки в акаунті Adspect |
Замініть ВАШ_КЛЮЧ і panel.example.com на свої.
Команди
GET/teams
Команди, у яких ви перебуваєте, за алфавітом. admin бачить усі команди панелі.
| Параметр | Що фільтрує |
|---|---|
search | Частина назви |
page, per_page | Сторінка та її розмір (за замовчуванням 100) |
curl https://panel.example.com/api/teams \
-H "Authorization: Bearer ВАШ_КЛЮЧ" \
-H "Accept: application/json"<?php
// composer require guzzlehttp/guzzle
require 'vendor/autoload.php';
$api = new GuzzleHttp\Client([
'base_uri' => 'https://panel.example.com/api/',
'headers' => ['Authorization' => 'Bearer ВАШ_КЛЮЧ', 'Accept' => 'application/json'],
'timeout' => 30,
]);
$teams = json_decode($api->get('teams')->getBody(), true)['data']['teams'];
foreach ($teams as $team) {
echo "{$team['id']} {$team['name']}" . PHP_EOL;
}# pip install requests
import requests
API = "https://panel.example.com/api"
HEADERS = {"Authorization": "Bearer ВАШ_КЛЮЧ", "Accept": "application/json"}
teams = requests.get(f"{API}/teams", headers=HEADERS, timeout=30).json()["data"]["teams"]
for team in teams:
print(team["id"], team["name"])// Node.js 18+, без залежностей; збережіть як script.mjs
const API = 'https://panel.example.com/api';
const headers = { Authorization: 'Bearer ВАШ_КЛЮЧ', Accept: 'application/json', 'Content-Type': 'application/json' };
const response = await fetch(`${API}/teams`, {
method: 'GET',
headers,
signal: AbortSignal.timeout(30000),
});
const { data } = await response.json();
for (const team of data.teams) {
console.log(team.id, team.name);
}Відповідь
{
"data": {
"meta": { "current_page": 1, "per_page": 100, "last_page": 1, "total": 1 },
"teams": [
{ "id": "WQby", "name": "Team A", "users_count": 4, "created_at": "05 Oct 2026 14:23", "updated_at": "05 Oct 2026 14:23" }
]
}
}Помилки - лише загальні, див. «Вступ до API».
Акаунти Cloudflare
GET/cloudflares
Акаунти Cloudflare панелі, основний (Primary) першим. Архівні не показуються. Самі акаунти заводить адміністратор у панелі.
| Параметр | Що фільтрує |
|---|---|
search | Частина email акаунта |
health | ok - лише робочі, error - лише з помилкою |
page, per_page | Сторінка та її розмір (за замовчуванням 100) |
curl "https://panel.example.com/api/cloudflares?health=ok" \
-H "Authorization: Bearer ВАШ_КЛЮЧ" \
-H "Accept: application/json"<?php
// composer require guzzlehttp/guzzle
require 'vendor/autoload.php';
$api = new GuzzleHttp\Client([
'base_uri' => 'https://panel.example.com/api/',
'headers' => ['Authorization' => 'Bearer ВАШ_КЛЮЧ', 'Accept' => 'application/json'],
'timeout' => 30,
]);
$response = $api->get('cloudflares', ['query' => ['health' => 'ok']]);
$accounts = json_decode($response->getBody(), true)['data']['cloudflares'];
foreach ($accounts as $account) {
echo "{$account['id']} {$account['email']}" . ($account['is_primary'] ? ' (основний)' : '') . PHP_EOL;
}# pip install requests
import requests
API = "https://panel.example.com/api"
HEADERS = {"Authorization": "Bearer ВАШ_КЛЮЧ", "Accept": "application/json"}
response = requests.get(f"{API}/cloudflares", headers=HEADERS, params={"health": "ok"}, timeout=30)
accounts = response.json()["data"]["cloudflares"]
for account in accounts:
print(account["id"], account["email"], "(основний)" if account["is_primary"] else "")// Node.js 18+, без залежностей; збережіть як script.mjs
const API = 'https://panel.example.com/api';
const headers = { Authorization: 'Bearer ВАШ_КЛЮЧ', Accept: 'application/json', 'Content-Type': 'application/json' };
const params = new URLSearchParams({ health: 'ok' });
const response = await fetch(`${API}/cloudflares?${params}`, {
method: 'GET',
headers,
signal: AbortSignal.timeout(30000),
});
const { data } = await response.json();
for (const account of data.cloudflares) {
console.log(account.id, account.email, account.is_primary ? '(основний)' : '');
}Відповідь
{
"data": {
"meta": { "current_page": 1, "per_page": 100, "last_page": 1, "total": 1 },
"cloudflares": [
{
"id": "Lm3T",
"email": "[email protected]",
"is_primary": true,
"archived": false,
"status_error": null,
"status_checked_at": "05 Oct 2026 14:00",
"domains_count": 12
}
]
}
}status_error - остання помилка перевірки акаунта, null - акаунт у порядку. domains_count - скільки доменів у ньому.
Помилки - лише загальні, див. «Вступ до API».
Акаунти фільтрації
GET/filter_accounts
Акаунти фільтрації трафіку, основний першим. Архівні не показуються.
| Параметр | Що фільтрує |
|---|---|
search | Частина назви |
type | Сервіс: adspect, fraudfilter або trafficarmor |
page, per_page | Сторінка та її розмір (за замовчуванням 100) |
curl "https://panel.example.com/api/filter_accounts?type=adspect" \
-H "Authorization: Bearer ВАШ_КЛЮЧ" \
-H "Accept: application/json"<?php
// composer require guzzlehttp/guzzle
require 'vendor/autoload.php';
$api = new GuzzleHttp\Client([
'base_uri' => 'https://panel.example.com/api/',
'headers' => ['Authorization' => 'Bearer ВАШ_КЛЮЧ', 'Accept' => 'application/json'],
'timeout' => 30,
]);
$response = $api->get('filter_accounts', ['query' => ['type' => 'adspect']]);
$accounts = json_decode($response->getBody(), true)['data']['filter_accounts'];
foreach ($accounts as $account) {
echo "{$account['id']} {$account['name']}" . PHP_EOL;
}# pip install requests
import requests
API = "https://panel.example.com/api"
HEADERS = {"Authorization": "Bearer ВАШ_КЛЮЧ", "Accept": "application/json"}
response = requests.get(f"{API}/filter_accounts", headers=HEADERS, params={"type": "adspect"}, timeout=30)
accounts = response.json()["data"]["filter_accounts"]
for account in accounts:
print(account["id"], account["name"])// Node.js 18+, без залежностей; збережіть як script.mjs
const API = 'https://panel.example.com/api';
const headers = { Authorization: 'Bearer ВАШ_КЛЮЧ', Accept: 'application/json', 'Content-Type': 'application/json' };
const params = new URLSearchParams({ type: 'adspect' });
const response = await fetch(`${API}/filter_accounts?${params}`, {
method: 'GET',
headers,
signal: AbortSignal.timeout(30000),
});
const { data } = await response.json();
for (const account of data.filter_accounts) {
console.log(account.id, account.name);
}Відповідь
{
"data": {
"meta": { "current_page": 1, "per_page": 100, "last_page": 1, "total": 1 },
"filter_accounts": [
{ "id": "Rt7Q", "name": "Adspect main", "type": "adspect", "is_primary": true, "archived": false }
]
}
}Помилки - лише загальні, див. «Вступ до API».
Потоки Adspect
GET/filter_accounts/{id}/streams
Потоки в акаунті Adspect. stream_id з відповіді - це filter_stream_id для PWA і сплітів.
| Параметр | Що це |
|---|---|
search | Частина назви потоку |
stream | stream_id потоку - повернути його в полі selected, навіть якщо він не потрапив у пошук |
refresh | 1 - запитати список у Adspect заново, оминаючи кеш |
Для fraudfilter і trafficarmor список завжди порожній: у цих сервісів немає API потоків, ідентифікатор потоку беріть у їхньому кабінеті.
curl "https://panel.example.com/api/filter_accounts/Rt7Q/streams?search=Promo" \
-H "Authorization: Bearer ВАШ_КЛЮЧ" \
-H "Accept: application/json"<?php
// composer require guzzlehttp/guzzle
require 'vendor/autoload.php';
$api = new GuzzleHttp\Client([
'base_uri' => 'https://panel.example.com/api/',
'headers' => ['Authorization' => 'Bearer ВАШ_КЛЮЧ', 'Accept' => 'application/json'],
'timeout' => 30,
]);
$response = $api->get('filter_accounts/Rt7Q/streams', ['query' => ['search' => 'Promo']]);
$streams = json_decode($response->getBody(), true)['data']['streams'];
foreach ($streams as $stream) {
echo "{$stream['stream_id']} {$stream['name']}" . PHP_EOL;
}# pip install requests
import requests
API = "https://panel.example.com/api"
HEADERS = {"Authorization": "Bearer ВАШ_КЛЮЧ", "Accept": "application/json"}
response = requests.get(f"{API}/filter_accounts/Rt7Q/streams", headers=HEADERS, params={"search": "Promo"}, timeout=30)
streams = response.json()["data"]["streams"]
for stream in streams:
print(stream["stream_id"], stream["name"])// Node.js 18+, без залежностей; збережіть як script.mjs
const API = 'https://panel.example.com/api';
const headers = { Authorization: 'Bearer ВАШ_КЛЮЧ', Accept: 'application/json', 'Content-Type': 'application/json' };
const params = new URLSearchParams({ search: 'Promo' });
const response = await fetch(`${API}/filter_accounts/Rt7Q/streams?${params}`, {
method: 'GET',
headers,
signal: AbortSignal.timeout(30000),
});
const { data } = await response.json();
for (const stream of data.streams) {
console.log(stream.stream_id, stream.name);
}Відповідь
{
"data": {
"streams": [
{ "stream_id": "a1b2c3", "name": "Promo EN", "mode": "Filter" },
{ "stream_id": "d4e5f6", "name": "Promo DE", "mode": "Filter" }
],
"selected": null
}
}Приходить не більше 100 потоків - якщо потрібного немає, уточніть search.
Помилки
| Код | message | Коли |
|---|---|---|
404 | Not found | Такого акаунта немає |
422 | Filter account not found | Акаунт в архіві |
422 | Adspect account has no API key | В акаунта Adspect не задано API-ключ |
422 | текст помилки від Adspect, наприклад Invalid API key | Adspect відхилив ключ акаунта |
502 | Adspect request failed | Adspect не відповів |
Не додавайте refresh=1 у цикли
Список потоків кешується на 5 хвилин. З refresh=1 кожен запит іде в Adspect - у циклі це швидко впреться в ліміти самого Adspect. Використовуйте його один раз, якщо щойно створили потік у кабінеті Adspect і не бачите його в списку.