The CSV file of a finished export job
GET /api/v1/delivery/exports/{id}/file
https://app.tanba-ooh.kz/api/v1/delivery/exports/{id}/file
Технический текст справочника написан на английском.
Scope read:delivery. One row per play as the player reported it, in the field names of the OpenDirect 2.1 Stats object and the UK Playout digital file: frameid (structure code), startdate and startutcoffset (local start), spotlength (seconds), creativeid (approval number), thirdpartycreativeref (SHA-256 of the media file), playerref (device id), plus tier and batch_sha256, the hash of the stored batch the play came in. The rows are the bytes the player sent: records the platform refused or counted as duplicates are not filtered out.
Аутентификация
Ключ API в заголовке Authorization или сессия консоли.
Право доступа: read:delivery
Параметры
| Имя | Где | Тип | Обязательный | Описание | Пример |
|---|---|---|---|---|---|
id | путь | string (uuid) | да | Id of the job. | 1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f |
Ответы
200 UTF-8 CSV with a byte-order mark and a header row.
text/csv
Пример
string
Ошибки
Ошибки приходят документом problem (application/problem+json) со стабильным полем code.
| Статус | Значение |
|---|---|
| 401 | Нет действительной сессии или ключа API (unauthenticated, session_expired, invalid_api_key). |
| 403 | Роль или право ключа этого не допускает (forbidden, key_scope_denied, key_route_denied). |
| 404 | Ничего нет или вызывающему это не видно. |
| default | Ошибка в виде документа problem. |
Примеры кода
curl
curl 'https://app.tanba-ooh.kz/api/v1/delivery/exports/1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/file' \
-H 'Authorization: Bearer YOUR_API_KEY'
Python
import requests
response = requests.get(
"https://app.tanba-ooh.kz/api/v1/delivery/exports/1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/file",
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/delivery/exports/1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/file", 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))
}