Агенты
Публичный API (0.0.0)
Публичный API 2ГИС ГеоПоток
Получение списка агентов
Возвращает страницу со списком агентов.
Authorizations:
query Parameters
| agent_ids | Array of strings Фильтр по идентификаторам агентов. |
| limit required | integer Максимальное число агентов в ответе, от 1 до 500. |
| cursor | string Курсор для получения следующей или предыдущей страницы результатов. |
Responses
Response Schema: application/json
required | object (CursorResponse) Курсоры следующей и предыдущей страниц результата. |
required | Array of objects (AgentResponse) Элементы текущей страницы. |
Response samples
- 200
- 400
- 401
- 500
{- "cursor": {
- "next": "string",
- "prev": "string"
}, - "items": [
- {
- "attributes": [
- {
- "data": {
- "attribute_id": "ef88e6be-6132-42c9-abcd-a9aadce04df6",
- "type": "text",
- "value": "string"
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "data_sources": [
- {
- "type": "mobile",
- "value": {
- "type": "mobile",
- "user_id": "string"
}
}
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}Создание агента
Создаёт агента по указанному шаблону.
Authorizations:
Request Body schema: application/jsonrequired
Данные для создания агента.
Array of objects (Attribute) Значения атрибутов агента. | |
Array of objects (AgentDataSource) Источники данных о местоположении агента. | |
| template_id required | string <uuid> Идентификатор шаблона агента. |
Responses
Response Schema: application/json
required | Array of objects (Attribute) Значения атрибутов агента. |
| created_at required | string <date-time> Дата и время создания агента в формате RFC 3339. |
required | Array of objects (AgentDataSource) Источники данных о местоположении агента. |
| id required | string <uuid> Идентификатор агента. |
| template_id required | string <uuid> Идентификатор шаблона агента. |
| updated_at required | string <date-time> Дата и время последнего обновления агента в формате RFC 3339. |
Request samples
- Payload
{- "attributes": [
- {
- "data": {
- "attribute_id": "ef88e6be-6132-42c9-abcd-a9aadce04df6",
- "type": "text",
- "value": "string"
}
}
], - "data_sources": [
- {
- "type": "mobile",
- "value": {
- "type": "mobile",
- "user_id": "string"
}
}
], - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc"
}Response samples
- 200
- 400
- 401
- 500
{- "attributes": [
- {
- "data": {
- "attribute_id": "ef88e6be-6132-42c9-abcd-a9aadce04df6",
- "type": "text",
- "value": "string"
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "data_sources": [
- {
- "type": "mobile",
- "value": {
- "type": "mobile",
- "user_id": "string"
}
}
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",
- "updated_at": "2019-08-24T14:15:22Z"
}Удаление агента
Удаляет агента по его идентификатору.
Authorizations:
path Parameters
| id required | string <uuid> Идентификатор агента. |
Responses
Response samples
- 400
- 401
- 404
- 500
{- "error_code": "string",
- "message": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "violations": [
- {
- "error_code": "string",
- "field": "string",
- "message": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}
}
]
}Получение агента
Возвращает данные агента по его идентификатору.
Authorizations:
path Parameters
| id required | string <uuid> Идентификатор агента. |
Responses
Response Schema: application/json
required | Array of objects (Attribute) Значения атрибутов агента. |
| created_at required | string <date-time> Дата и время создания агента в формате RFC 3339. |
required | Array of objects (AgentDataSource) Источники данных о местоположении агента. |
| id required | string <uuid> Идентификатор агента. |
| template_id required | string <uuid> Идентификатор шаблона агента. |
| updated_at required | string <date-time> Дата и время последнего обновления агента в формате RFC 3339. |
Response samples
- 200
- 400
- 401
- 404
- 500
{- "attributes": [
- {
- "data": {
- "attribute_id": "ef88e6be-6132-42c9-abcd-a9aadce04df6",
- "type": "text",
- "value": "string"
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "data_sources": [
- {
- "type": "mobile",
- "value": {
- "type": "mobile",
- "user_id": "string"
}
}
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",
- "updated_at": "2019-08-24T14:15:22Z"
}Обновление агента
Обновляет данные агента по его идентификатору.
Authorizations:
path Parameters
| id required | string <uuid> Идентификатор агента. |
Request Body schema: application/jsonrequired
Новые значения атрибутов агента.
Array of objects (Attribute) Значения атрибутов агента. | |
Array of objects (AgentDataSource) Источники данных о местоположении агента. | |
| template_id required | string <uuid> Идентификатор шаблона агента. |
Responses
Response Schema: application/json
required | Array of objects (Attribute) Значения атрибутов агента. |
| created_at required | string <date-time> Дата и время создания агента в формате RFC 3339. |
required | Array of objects (AgentDataSource) Источники данных о местоположении агента. |
| id required | string <uuid> Идентификатор агента. |
| template_id required | string <uuid> Идентификатор шаблона агента. |
| updated_at required | string <date-time> Дата и время последнего обновления агента в формате RFC 3339. |
Request samples
- Payload
{- "attributes": [
- {
- "data": {
- "attribute_id": "ef88e6be-6132-42c9-abcd-a9aadce04df6",
- "type": "text",
- "value": "string"
}
}
], - "data_sources": [
- {
- "type": "mobile",
- "value": {
- "type": "mobile",
- "user_id": "string"
}
}
], - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc"
}Response samples
- 200
- 400
- 401
- 404
- 500
{- "attributes": [
- {
- "data": {
- "attribute_id": "ef88e6be-6132-42c9-abcd-a9aadce04df6",
- "type": "text",
- "value": "string"
}
}
], - "created_at": "2019-08-24T14:15:22Z",
- "data_sources": [
- {
- "type": "mobile",
- "value": {
- "type": "mobile",
- "user_id": "string"
}
}
], - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",
- "updated_at": "2019-08-24T14:15:22Z"
}