Fetch the signed commands waiting for a CMS installation
GET /api/v1/cms/commands
https://app.tanba-ooh.kz/api/v1/cms/commands
Технический текст справочника написан на английском.
Scope relay:commands. Operator organisations only. Returns the commands (cut-off, restore, restart, content switch, emergency broadcast) that address structures linked to the installation and that the installation has not yet been given. Each item carries the signed envelope exactly as the signer stored it, in envelope as base64 of the DER bytes; the platform has already checked it against the command roots and against the command's own row before handing it out, and a command that fails the check is never listed. A command is handed out once and again after 5 minutes if it has not been acknowledged, at most three times; a delivery without an answer after the third try is recorded as failed (no_result). The command is signed by the platform: the installation executes it and acknowledges it, and the console shows the delivery as relayed and not verified on the device.
With wait the call holds the connection for up to that many seconds until a command is available, and answers an empty list when none came. A retired installation answers 409 installation_retired; an installation of another organisation is not found.
Аутентификация
Ключ API в заголовке Authorization.
Право доступа: relay:commands
Параметры
| Имя | Где | Тип | Обязательный | Описание | Пример |
|---|---|---|---|---|---|
installation | запрос | string (uuid) | да | Identifier of the registered CMS installation. | 5d0c8e7a-21b4-4c3f-9a6e-0b1d2c3e4f50 |
wait | запрос | integer | нет | Seconds to hold the call open when nothing is waiting, 0 to 30. | 30 |
Ответы
200 The waiting commands, oldest first, an emergency broadcast before the rest.
application/json
| Имя | Тип | Обязательный | Описание | Пример |
|---|---|---|---|---|
items | array of object | да | Commands to execute; empty when none is waiting. | |
items[].command_id | string (uuid) | да | Identifier of the command; the envelope names the same one. | "01a1377e-c8e3-7c41-8ae9-3a8dc9413fbd" |
items[].type | string | да | What to do. cutoff, restore, restart, content_switch, emergency_broadcast | |
items[].scope | string | да | How the command was addressed. device, structure, operator, district, all | |
items[].scenario | string | null | да | Name of the scenario for a content switch or an emergency broadcast; otherwise null. | null |
items[].issued_at | string (date-time) | да | When the command was issued. | "2026-10-14T09:00:00+05:00" |
items[].not_after | string (date-time) | да | The command must not be executed after this moment. | "2026-10-14T10:00:00+05:00" |
items[].structures | array of object | да | The structures of this installation the command applies to; acknowledge each one. | |
items[].structures[].id | string (uuid) | да | Identifier of the structure. | "82895149-94fa-4a60-9604-d95e705c6212" |
items[].structures[].code | string | да | Code of the structure. | "ALM-0012" |
items[].envelope | string | да | Base64 of the signed command envelope (DER). | "MIIGvQYJKoZIhvcNAQcCoIIGrjCCBqoCAQExDzANBglghkgBZQMEAgEFADCB" |
Пример
{
"items": [
{
"command_id": "01a1377e-c8e3-7c41-8ae9-3a8dc9413fbd",
"type": "cutoff",
"scope": "structure",
"scenario": null,
"issued_at": "2026-10-14T09:00:00+05:00",
"not_after": "2026-10-14T10:00:00+05:00",
"structures": [
{
"id": "82895149-94fa-4a60-9604-d95e705c6212",
"code": "ALM-0012"
}
],
"envelope": "MIIGvQYJKoZIhvcNAQcCoIIGrjCCBqoCAQExDzANBglghkgBZQMEAgEFADCB"
}
]
}
Ошибки
Ошибки приходят документом problem (application/problem+json) со стабильным полем code.
| Статус | Значение |
|---|---|
| 401 | Нет действительной сессии или ключа API (unauthenticated, session_expired, invalid_api_key). |
| 403 | Роль или право ключа этого не допускает (forbidden, key_scope_denied, key_route_denied). |
| 404 | Ничего нет или вызывающему это не видно. |
| 409 | The installation is retired (installation_retired). |
| 422 | Ошибки полей (validation_failed). |
| 429 | Превышен предел частоты; см. Retry-After. |
| 503 | The platform cannot check command signatures now (command_roots_unavailable); retry later, commands are not lost. |
| default | Ошибка в виде документа problem. |
Примеры кода
curl
curl 'https://app.tanba-ooh.kz/api/v1/cms/commands?installation=5d0c8e7a-21b4-4c3f-9a6e-0b1d2c3e4f50' \
-H 'Authorization: Bearer YOUR_API_KEY'
Python
import requests
response = requests.get(
"https://app.tanba-ooh.kz/api/v1/cms/commands?installation=5d0c8e7a-21b4-4c3f-9a6e-0b1d2c3e4f50",
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/cms/commands?installation=5d0c8e7a-21b4-4c3f-9a6e-0b1d2c3e4f50", 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))
}