Agents
Public API (0.0.0)
2GIS GeoFlow Public API
Getting a list of agents
Returns a page with a list of agents.
Authorizations:
query Parameters
| agent_ids | Array of strings Filter by agent identifiers. |
| limit required | integer Maximum number of agents in the response, from 1 to 500. |
| cursor | string Cursor for getting the next or previous page of results. |
Responses
Response Schema: application/json
required | object (CursorResponse) Cursors for the next and previous result pages. |
required | Array of objects (AgentResponse) Current page items. |
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"
}
]
}Creating an agent
Creates an agent using the specified template.
Authorizations:
Request Body schema: application/jsonrequired
Data for creating an agent.
Array of objects (Attribute) Values of agent attributes. | |
Array of objects (AgentDataSource) Agent location data sources. | |
| template_id required | string <uuid> Agent template identifier. |
Responses
Response Schema: application/json
required | Array of objects (Attribute) Values of agent attributes. |
| created_at required | string <date-time> Date and time of agent creation in RFC 3339 format. |
required | Array of objects (AgentDataSource) Agent location data sources. |
| id required | string <uuid> Agent identifier. |
| template_id required | string <uuid> Agent template identifier. |
| updated_at required | string <date-time> Date and time of the agent's last update in RFC 3339 format. |
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"
}Deleting an agent
Deletes an agent by its identifier.
Authorizations:
path Parameters
| id required | string <uuid> Agent identifier. |
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"
}
}
]
}Getting an agent
Returns agent data by its identifier.
Authorizations:
path Parameters
| id required | string <uuid> Agent identifier. |
Responses
Response Schema: application/json
required | Array of objects (Attribute) Values of agent attributes. |
| created_at required | string <date-time> Date and time of agent creation in RFC 3339 format. |
required | Array of objects (AgentDataSource) Agent location data sources. |
| id required | string <uuid> Agent identifier. |
| template_id required | string <uuid> Agent template identifier. |
| updated_at required | string <date-time> Date and time of the agent's last update in RFC 3339 format. |
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"
}Updating an agent
Updates agent data by its identifier.
Authorizations:
path Parameters
| id required | string <uuid> Agent identifier. |
Request Body schema: application/jsonrequired
New values of agent attributes.
Array of objects (Attribute) Values of agent attributes. | |
Array of objects (AgentDataSource) Agent location data sources. | |
| template_id required | string <uuid> Agent template identifier. |
Responses
Response Schema: application/json
required | Array of objects (Attribute) Values of agent attributes. |
| created_at required | string <date-time> Date and time of agent creation in RFC 3339 format. |
required | Array of objects (AgentDataSource) Agent location data sources. |
| id required | string <uuid> Agent identifier. |
| template_id required | string <uuid> Agent template identifier. |
| updated_at required | string <date-time> Date and time of the agent's last update in RFC 3339 format. |
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"
}