Skip to main content

Изменение location

Метод необходим для изменения параметров объекта location

Параметры запроса

POST /api/clients/v1/locations/

Headers

  • Content-Type: application/json
  • Authorization: Bearer $access_token

JSON body

ПараметрТипОграниченияОписаниеПример
namestringОбязательныйНазвание location/images
typestringmatching | namedТип location. По умолчанию matchingmatching
headersobject[]< 10Список дополнительных HTTP-заголовков
headers.keystring< 1024Название заголовкаX-MEDIA-TYPE
headers.valuestring< 32768Значение заголовка.pptx
cors_headersobjectОбъект CORS заголовков
cors_headers.access_control_allow_originobject[string]< 50["example.com"]
cors_headers.access_control_expose_headersobject[string]< 50["Content-Encoding"]
cors_headers.access_control_max_ageinteger< 86400600
cors_headers.access_control_allow_credentialsbooleantrue
cors_headers.access_control_allow_methodsobject[string]OPTIONS | GET | HEAD | PUT | PATCH | POST | DELETE["OPTIONS"]
cors_headers.access_control_allow_headersobject[string]< 50[*]

Параметры ответа

JSON body

ПараметрТипОписание
idintegerID location
namestringНазвание location
typestringТип location
domain_idintegerID домена
headersobject[]Список дополнительных HTTP-заголовков
headers.keystringНазвание заголовка
headers.valuestringЗначение заголовка
cors_headersobject{}Объект CORS заголовков
cors_headers.access_control_allow_originobject[string]
cors_headers.access_control_expose_headersobject[string]
cors_headers.access_control_max_ageinteger
cors_headers.access_control_allow_credentialsboolean
cors_headers.access_control_allow_methodsobject[string]
cors_headers.access_control_allow_headersobject[string]
201 Created

Объект location

{
"id": 1,
"name": "/images",
"type": "matching",
"domain_id": 1,
"headers": [
{
"key": "X-MEDIA-TYPE",
"value": ".pptx"
}
],
"cors_headers": {
"access_control_allow_origin": [
"*"
],
"access_control_expose_headers": [
"*"
],
"access_control_max_age": 600,
"access_control_allow_credentials": true,
"access_control_allow_methods": [
"OPTIONS"
],
"access_control_allow_headers": [
"X-MEDIA-TYPE"
]
}
}
400 Bad Request

Указаны невалидные или отсутствуют обязательные body-параметры

    {
"domain_id": [
"Domain with ID {domain_id} not found"
],
"name": [
"Invalid location name"
],
"headers": [
"Invalid header key"
]
}
401 Unauthorized

Учетные данные для аутентификации отсутствуют или недействительны

{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
403 Forbidden

Объект location можно привязать только к домену своего проекта

{
"detail": "Only participants can view this project's locations"
}
409 Conflict

Location с такими параметрами уже существует

{
"detail": "Location already exists"
}