Изменение location
Метод необходим для изменения параметров объекта location
Параметры запроса
POST /api/clients/v1/locations/
Headers
- Content-Type: application/json
- Authorization: Bearer
$access_token
JSON body
Параметр | Тип | Ограничения | Описание | Пример |
---|---|---|---|---|
name | string | Обязательный | Название location | /images |
type | string | matching | named | Тип location. По умолчанию matching | matching |
headers | object[] | < 10 | Список дополнительных HTTP-заголовков | |
headers.key | string | < 1024 | Название заголовка | X-MEDIA-TYPE |
headers.value | string | < 32768 | Значение заголовка | .pptx |
cors_headers | object | Объект CORS заголовков | ||
cors_headers.access_control_allow_origin | object[string] | < 50 | ["example.com"] | |
cors_headers.access_control_expose_headers | object[string] | < 50 | ["Content-Encoding"] | |
cors_headers.access_control_max_age | integer | < 86400 | 600 | |
cors_headers.access_control_allow_credentials | boolean | true | ||
cors_headers.access_control_allow_methods | object[string] | OPTIONS | GET | HEAD | PUT | PATCH | POST | DELETE | ["OPTIONS"] | |
cors_headers.access_control_allow_headers | object[string] | < 50 | [*] |
Параметры ответа
JSON body
Параметр | Тип | Описание |
---|---|---|
id | integer | ID location |
name | string | Название location |
type | string | Тип location |
domain_id | integer | ID домена |
headers | object[] | Список дополнительных HTTP-заголовков |
headers.key | string | Название заголовка |
headers.value | string | Значение заголовка |
cors_headers | object{} | Объект CORS заголовков |
cors_headers.access_control_allow_origin | object[string] | |
cors_headers.access_control_expose_headers | object[string] | |
cors_headers.access_control_max_age | integer | |
cors_headers.access_control_allow_credentials | boolean | |
cors_headers.access_control_allow_methods | object[string] | |
cors_headers.access_control_allow_headers | object[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"
}