One section of the city operational report as CSV
GET /api/v1/exports/stats-reports/{name}
https://app.tanba-ooh.kz/api/v1/exports/stats-reports/{name}
Анықтамалықтың техникалық мәтіні ағылшын тілінде жазылған.
Scope read:stats. Names are series, load, anomalies and reconciliation; the query is that of the report.
Аутентификация
Authorization тақырыбындағы API кілті немесе консоль сеансы.
Рұқсат: read:stats
Параметрлер
| Атауы | Орны | Түрі | Міндетті | Сипаттама | Мысал |
|---|---|---|---|---|---|
name | жол | string | иә | Section of the city report: series, load, anomalies or reconciliation. series, load, anomalies, reconciliation | series |
from | сұрау | string (date) | жоқ | First day, YYYY-MM-DD. | 2026-09-08 |
to | сұрау | string (date) | жоқ | Last day, YYYY-MM-DD. | 2026-10-06 |
grain | сұрау | string | жоқ | Length of one period: day, week or month. day, week, month | day |
sep | сұрау | string | жоқ | Column separator; semicolon for spreadsheets set to a comma decimal mark. comma, semicolon | comma |
Жауаптар
200 UTF-8 CSV with a byte-order mark and a header row.
text/csv
Мысал
string
Қателер
Қателер problem құжаты (application/problem+json) түрінде, тұрақты code өрісімен келеді.
| Мәртебесі | Мағынасы |
|---|---|
| 401 | No valid session or API key (unauthenticated, session_expired, invalid_api_key). |
| 403 | The role or the key's scope does not allow this (forbidden, key_scope_denied, key_route_denied). |
| 404 | Unknown section. |
| 422 | Field errors (validation_failed). |
| default | An error as a problem document. |
Код мысалдары
curl
curl 'https://app.tanba-ooh.kz/api/v1/exports/stats-reports/series' \
-H 'Authorization: Bearer YOUR_API_KEY'
Python
import requests
response = requests.get(
"https://app.tanba-ooh.kz/api/v1/exports/stats-reports/series",
headers={
"Authorization": "Bearer YOUR_API_KEY",
},
)
print(response.status_code, response.text)
Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://app.tanba-ooh.kz/api/v1/exports/stats-reports/series", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(data))
}