Is this creative file approved?
GET /api/v1/creatives/{sha256}
https://app.tanba-ooh.kz/api/v1/creatives/{sha256}
Анықтамалықтың техникалық мәтіні ағылшын тілінде жазылған.
Scope read:creatives. Looks a media file up by the SHA-256 of its bytes and lists every approval issued for it: its status, validity window, the structure codes it covers, category, length and size, and where to fetch the envelope. Issued approvals are public facts and shown to every caller. A submission still under review, or rejected, is shown only to the organisation that submitted it, as pending or rejected. A file that is unknown, or known only through someone else's unfinished submission, answers 404. Keep a cache and refresh it from the signed revocation list (GET /v1/revocations/latest) and the approval.revoked webhook; the answer carries the version of the newest list. A serve outside the listed structures raises the city event wrong_structure.
Аутентификация
Authorization тақырыбындағы API кілті немесе консоль сеансы.
Рұқсат: read:creatives
Параметрлер
| Атауы | Орны | Түрі | Міндетті | Сипаттама | Мысал |
|---|---|---|---|---|---|
sha256 | жол | string | иә | Lowercase hexadecimal SHA-256 of the media file. | 2419fe2d001c9185b3b903283894a5d955f45a57d1eaf1c6b787759650f00a17 |
Жауаптар
200 The approvals of the file, newest first.
application/json
CreativeAnswer
| Атауы | Түрі | Міндетті | Сипаттама | Мысал |
|---|---|---|---|---|
sha256 | string | иә | The hash that was asked for. | "2419fe2d001c9185b3b903283894a5d955f45a57d1eaf1c6b787759650f00a17" |
approvals | array of CreativeEntry | иә | Newest first. | |
approvals[].status | string | иә | valid, not_yet_valid, expired and revoked describe an issued approval. pending and rejected describe a submission of the caller's own organisation that has no approval. valid, not_yet_valid, expired, revoked, pending, rejected | |
approvals[].approval_number | string | null | иә | Number of the approval; null for pending and rejected. | "TNB-2026-123456" |
approvals[].submission_number | string | null | иә | Number of the submission; only filled for the caller's own submissions. | "SUB-2026-000001" |
approvals[].valid_from | string | null (date) | иә | First day of the approval; for pending and rejected, the first day of the requested period. | "2026-10-14" |
approvals[].valid_until | string | null (date) | иә | Last day of the approval; for pending and rejected, the last day of the requested period. | "2026-11-13" |
approvals[].structures | array of string | иә | Codes of the structures the approval covers. | ["ALM-0001", "ALM-0002"] |
approvals[].category_id | integer | null | иә | Product category: an id from GET /api/v1/categories. | 1004 |
approvals[].duration_ms | integer | null | иә | Length of the video in milliseconds; null for images. | 15000 |
approvals[].width | integer | null | иә | Width of the media in pixels. | 1920 |
approvals[].height | integer | null | иә | Height of the media in pixels. | 1080 |
approvals[].envelope_url | string | null (uri) | иә | Where to fetch the signed envelope (needs the same credentials); null without an approval. | "https://app.tanba-ooh.kz/api/v1/approvals/TNB-2026-123456/envelope" |
revocation_list_version | integer | null | иә | Version of the newest signed revocation list; null before the first one. | 42 |
Мысал
{
"sha256": "2419fe2d001c9185b3b903283894a5d955f45a57d1eaf1c6b787759650f00a17",
"approvals": [
{
"status": "valid",
"approval_number": "TNB-2026-123456",
"submission_number": "SUB-2026-000001",
"valid_from": "2026-10-14",
"valid_until": "2026-11-13",
"structures": [
"ALM-0001",
"ALM-0002"
],
"category_id": 1004,
"duration_ms": 15000,
"width": 1920,
"height": 1080,
"envelope_url": "https://app.tanba-ooh.kz/api/v1/approvals/TNB-2026-123456/envelope"
}
],
"revocation_list_version": 42
}
Қателер
Қателер 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 | Nothing there, or not visible to the caller. |
| 422 | Field errors (validation_failed). |
| default | An error as a problem document. |
Код мысалдары
curl
curl 'https://app.tanba-ooh.kz/api/v1/creatives/2419fe2d001c9185b3b903283894a5d955f45a57d1eaf1c6b787759650f00a17' \
-H 'Authorization: Bearer YOUR_API_KEY'
Python
import requests
response = requests.get(
"https://app.tanba-ooh.kz/api/v1/creatives/2419fe2d001c9185b3b903283894a5d955f45a57d1eaf1c6b787759650f00a17",
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/creatives/2419fe2d001c9185b3b903283894a5d955f45a57d1eaf1c6b787759650f00a17", 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))
}