One delivery campaign
GET /api/v1/delivery/campaigns/{id}
https://app.tanba-ooh.kz/api/v1/delivery/campaigns/{id}
Анықтамалықтың техникалық мәтіні ағылшын тілінде жазылған.
Scope read:delivery. Only members of the organisation that owns the campaign can read it.
Аутентификация
Authorization тақырыбындағы API кілті немесе консоль сеансы.
Рұқсат: read:delivery
Параметрлер
| Атауы | Орны | Түрі | Міндетті | Сипаттама | Мысал |
|---|---|---|---|---|---|
id | жол | string (uuid) | иә | Id of the campaign. | 7a1f0c2e-5b6d-4e8f-9a0b-1c2d3e4f5a6b |
Жауаптар
200 The campaign.
application/json
DeliveryCampaign
| Атауы | Түрі | Міндетті | Сипаттама | Мысал |
|---|---|---|---|---|
id | string (uuid) | иә | Id of the campaign. | "7a1f0c2e-5b6d-4e8f-9a0b-1c2d3e4f5a6b" |
name | string | иә | Name of the campaign, unique within the organisation. | "Autumn campaign" |
external_ref | string | иә | The organisation's own reference, such as an order number; may be empty. | "PO-2026-17" |
period_from | string (date) | иә | First day of the campaign. | "2026-10-01" |
period_to | string (date) | иә | Last day of the campaign. | "2026-10-31" |
approvals | array of string | иә | Numbers of the approvals of the campaign. | |
created_at | string | иә | When the campaign was created, Almaty time. | "2026-10-01T09:00:00+05:00" |
updated_at | string | иә | When the campaign was last changed, Almaty time. | "2026-10-02T10:00:00+05:00" |
Мысал
{
"id": "7a1f0c2e-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
"name": "Autumn campaign",
"external_ref": "PO-2026-17",
"period_from": "2026-10-01",
"period_to": "2026-10-31",
"approvals": [
"TNB-2026-000123"
],
"created_at": "2026-10-01T09:00:00+05:00",
"updated_at": "2026-10-02T10:00:00+05:00"
}
Қателер
Қателер 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. |
| default | An error as a problem document. |
Код мысалдары
curl
curl 'https://app.tanba-ooh.kz/api/v1/delivery/campaigns/7a1f0c2e-5b6d-4e8f-9a0b-1c2d3e4f5a6b' \
-H 'Authorization: Bearer YOUR_API_KEY'
Python
import requests
response = requests.get(
"https://app.tanba-ooh.kz/api/v1/delivery/campaigns/7a1f0c2e-5b6d-4e8f-9a0b-1c2d3e4f5a6b",
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/campaigns/7a1f0c2e-5b6d-4e8f-9a0b-1c2d3e4f5a6b", 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))
}