TAŇBA-OOH Разработчикам

Plays per structure and day as CSV

GET /api/v1/exports/stats.csv

https://app.tanba-ooh.kz/api/v1/exports/stats.csv

Технический текст справочника написан на английском.

Scope read:stats. Days are Asia/Almaty days. plays, duration_ms and approvals come from the plays the players reported over the authenticated channel. imported_plays is the sum an operator reported from its own CMS for that structure and day (empty when nothing was imported), and reconciled_ratio is imported divided by reported over the reconciled approvals of that day (empty while the day is open or the players reported nothing). Imported plays are for comparison only; they are never billed.

Аутентификация

Ключ API в заголовке Authorization или сессия консоли.

Право доступа: read:stats

Параметры

ИмяГдеТипОбязательныйОписаниеПример
sepзапросstringнетColumn separator; semicolon for spreadsheets set to a comma decimal mark. comma, semicoloncomma

Ответы

200 CSV в UTF-8 с меткой порядка байтов и строкой заголовков.

text/csv

Пример

string

Ошибки

Ошибки приходят документом problem (application/problem+json) со стабильным полем code.

СтатусЗначение
401Нет действительной сессии или ключа API (unauthenticated, session_expired, invalid_api_key).
403Роль или право ключа этого не допускает (forbidden, key_scope_denied, key_route_denied).
defaultОшибка в виде документа problem.

Примеры кода

curl

curl 'https://app.tanba-ooh.kz/api/v1/exports/stats.csv' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Python
import requests

response = requests.get(
    "https://app.tanba-ooh.kz/api/v1/exports/stats.csv",
    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.csv", 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))
}