TAŇBA-OOH Әзірлеушілерге

Replace a structure set

PUT /api/v1/structure-sets/{id}

https://app.tanba-ooh.kz/api/v1/structure-sets/{id}

Анықтамалықтың техникалық мәтіні ағылшын тілінде жазылған.

Scope write:submissions. Replaces the name and the structures. Submissions already created keep the structures they expanded to.

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

Authorization тақырыбындағы API кілті немесе консоль сеансы.

Рұқсат: write:submissions

Параметрлер

АтауыОрныТүріМіндеттіСипаттамаМысал
idжолstring (uuid)иәId of the set.5d3f3e0a-2a53-4b3c-8d0a-6f63b4d9a111

Сұраудың денесі

application/json

StructureSetInput

АтауыТүріМіндеттіСипаттамаМысал
namestringиәName, unique within the organisation."Almaty city boards"
structure_idsarray of string (uuid)иәStructures of the set; repeats are dropped.["0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"]

Мысал

{
  "name": "Almaty city boards",
  "structure_ids": [
    "0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"
  ]
}

Жауаптар

200 The updated set.

application/json

StructureSet

АтауыТүріМіндеттіСипаттамаМысал
idstring (uuid)иәId of the set."5d3f3e0a-2a53-4b3c-8d0a-6f63b4d9a111"
namestringиәName, unique within the organisation."Almaty city boards"
structure_idsarray of string (uuid)иәStructures of the set in the order given.["0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"]
created_atstringиәWhen the set was saved first."2026-10-14T10:00:00+05:00"
updated_atstringиәWhen the set was last changed."2026-10-14T10:00:00+05:00"

Мысал

{
  "id": "5d3f3e0a-2a53-4b3c-8d0a-6f63b4d9a111",
  "name": "Almaty city boards",
  "structure_ids": [
    "0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"
  ],
  "created_at": "2026-10-14T10:00:00+05:00",
  "updated_at": "2026-10-14T10:00:00+05:00"
}

Қателер

Қателер problem құжаты (application/problem+json) түрінде, тұрақты code өрісімен келеді.

МәртебесіМағынасы
401No valid session or API key (unauthenticated, session_expired, invalid_api_key).
403The role or the key's scope does not allow this (forbidden, key_scope_denied, key_route_denied).
404Nothing there, or not visible to the caller.
409An error as a problem document.
422Field errors (validation_failed).
defaultAn error as a problem document.

Код мысалдары

curl

curl -X PUT 'https://app.tanba-ooh.kz/api/v1/structure-sets/5d3f3e0a-2a53-4b3c-8d0a-6f63b4d9a111' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Almaty city boards",
  "structure_ids": [
    "0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"
  ]
}'
Python
import requests

response = requests.put(
    "https://app.tanba-ooh.kz/api/v1/structure-sets/5d3f3e0a-2a53-4b3c-8d0a-6f63b4d9a111",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "name": "Almaty city boards",
        "structure_ids": [
            "0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11",
        ],
    },
)
print(response.status_code, response.text)
Go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "name": "Almaty city boards",
  "structure_ids": [
    "0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"
  ]
}`)
	req, err := http.NewRequest("PUT", "https://app.tanba-ooh.kz/api/v1/structure-sets/5d3f3e0a-2a53-4b3c-8d0a-6f63b4d9a111", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
	req.Header.Set("Content-Type", "application/json")
	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))
}