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

Send a complaint

POST /v1/complaint

https://verify.tanba-ooh.kz/v1/complaint

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

A form (multipart/form-data or url-encoded). Only category and text are required; code, photo (JPEG or PNG, 10 MB at most, metadata is removed) and contact are optional. website is a trap for bots and stays empty. At most 10 per client address per hour.

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

Қажет емес. Шақыру ашық.

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

multipart/form-data

АтауыТүріМіндеттіСипаттамаМысал
categorystringиәKind of complaint. no_permit, offensive, dangerous, other
textstringиәWhat the complaint says, up to 2000 characters."The sign hangs over the pavement and looks loose."
codestringCode of the structure, if known."ALM-0012"
contactstringHow to reach the sender; optional."name@example.org"
photostring (binary)Photo of the structure, JPEG or PNG, at most 10 MB; metadata is removed.
websitestringTrap for bots; leave it empty.""

Жауаптар

201 Received.

application/json

АтауыТүріМіндеттіСипаттамаМысал
statusconstиәAlways received."received"

Мысал

{
  "status": "received"
}

text/html

Қателер

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

МәртебесіМағынасы
413An error as a problem document.
415An error as a problem document.
422An error as a problem document.
429Rate limit, 10 complaints per client address per hour; see Retry-After.
defaultAn error as a problem document.

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

curl

curl -X POST 'https://verify.tanba-ooh.kz/v1/complaint' \
  -H 'Accept: application/json' \
  -F 'category=no_permit' \
  -F 'text=The sign hangs over the pavement and looks loose.' \
  -F 'code=ALM-0012' \
  -F 'contact=name@example.org' \
  -F 'website='
Python
import requests

response = requests.post(
    "https://verify.tanba-ooh.kz/v1/complaint",
    headers={
        "Accept": "application/json",
    },
    files={
        "category": (None, "no_permit"),
        "text": (None, "The sign hangs over the pavement and looks loose."),
        "code": (None, "ALM-0012"),
        "contact": (None, "name@example.org"),
        "website": (None, ""),
    },
)
print(response.status_code, response.text)