mirror of
https://github.com/traccar/traccar.git
synced 2026-06-13 19:34:58 -04:00
1950 lines
59 KiB
JSON
1950 lines
59 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"version": "3.8",
|
|
"title": "traccar"
|
|
},
|
|
"host": "traccar.org",
|
|
"basePath": "/api",
|
|
"schemes": [
|
|
"http"
|
|
],
|
|
"paths": {
|
|
"/commands": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/Command"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Command"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/devices": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "all",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"name": "userId",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Device"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/Device"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Device"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/devices/{id}": {
|
|
"put": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/Device"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Device"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/devices/{id}/distance": {
|
|
"put": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/DeviceTotalDistance"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/devices/geofences": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/DeviceGeofence"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/DeviceGeofence"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/DeviceGeofence"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/groups": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "all",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"name": "userId",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Group"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/Group"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Group"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/groups/{id}": {
|
|
"put": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/Group"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Group"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/groups/geofences": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/GroupGeofence"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/GroupGeofence"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/GroupGeofence"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/permissions/devices": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/DevicePermission"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/DevicePermission"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/DevicePermission"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/permissions/groups": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/GroupPermission"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/GroupPermission"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/GroupPermission"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/permissions/geofences": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/GeofencePermission"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/GeofencePermission"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/GeofencePermission"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/positions": {
|
|
"get": {
|
|
"summary" : "Fetches a list of Positions",
|
|
"description" : "Without any params, it returns a list of last known positions for all the user's devices",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "deviceId",
|
|
"in": "query",
|
|
"description": "_deviceId_ is optional, but requires the _from_ and _to_ parameters when used",
|
|
"required": false,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "from",
|
|
"in": "query",
|
|
"description": "Not required with _id_",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "to",
|
|
"in": "query",
|
|
"description": "Not required with _id_",
|
|
"required": false,
|
|
"type": "string"
|
|
}, {
|
|
"name" : "id",
|
|
"in" : "query",
|
|
"description" : "To fetch one or more positions. Multiple params can be passed like `id=31&id=42`",
|
|
"required" : false,
|
|
"type" : "integer",
|
|
"collectionFormat" : "multi"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Position"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/server": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Server"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/Server"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Server"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/session": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/x-www-form-urlencoded"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"headers": {}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"application/x-www-form-urlencoded"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "email",
|
|
"in": "formData",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "password",
|
|
"in": "formData",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"headers": {}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/x-www-form-urlencoded"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/{id}": {
|
|
"put": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/notifications": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "all",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"name": "userId",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Notification"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/Notification"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Notification"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/commandtypes": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "deviceId",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/CommandType"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/geofences": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "all",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"name": "userId",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "groupId",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "deviceId",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "refresh",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "boolean"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Geofence"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/Geofence"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Geofence"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/geofences/{id}": {
|
|
"put": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/Geofence"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Geofence"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/events/{id}": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/Event"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/reports/route": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "deviceId",
|
|
"in": "query",
|
|
"description": "at least one deviceId or one groupId must be passed",
|
|
"required": true,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"name": "groupId",
|
|
"in": "query",
|
|
"description": "at least one deviceId or one groupId must be passed",
|
|
"required": true,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"name": "from",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "to",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Position"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/reports/events": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "deviceId",
|
|
"in": "query",
|
|
"description": "at least one deviceId or one groupId must be passed",
|
|
"required": true,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"name": "groupId",
|
|
"in": "query",
|
|
"description": "at least one deviceId or one groupId must be passed",
|
|
"required": true,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"name": "type",
|
|
"in": "query",
|
|
"description": "% can be used to return events of all types",
|
|
"required": true,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "from",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "to",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Event"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/reports/summary": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "deviceId",
|
|
"in": "query",
|
|
"description": "at least one deviceId or one groupId must be passed",
|
|
"required": true,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"name": "groupId",
|
|
"in": "query",
|
|
"description": "at least one deviceId or one groupId must be passed",
|
|
"required": true,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"name": "from",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "to",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/ReportSummary"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/reports/trips": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "deviceId",
|
|
"in": "query",
|
|
"description": "at least one deviceId or one groupId must be passed",
|
|
"required": true,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"name": "groupId",
|
|
"in": "query",
|
|
"description": "at least one deviceId or one groupId must be passed",
|
|
"required": true,
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"name": "from",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "to",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/ReportTrips"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/statistics": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "from",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "to",
|
|
"in": "query",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/Statistics"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/attributes/aliases": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "deviceId",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/AttributeAlias"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/AttributeAlias"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/AttributeAlias"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/attributes/aliases/{id}": {
|
|
"put": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/AttributeAlias"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"headers": {},
|
|
"schema": {
|
|
"$ref": "#/definitions/AttributeAlias"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "integer"
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "No Content",
|
|
"headers": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"Position": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"deviceId": {
|
|
"type": "integer"
|
|
},
|
|
"protocol": {
|
|
"type": "string"
|
|
},
|
|
"deviceTime": {
|
|
"type": "string"
|
|
},
|
|
"fixTime": {
|
|
"type": "string"
|
|
},
|
|
"outdated": {
|
|
"type": "boolean"
|
|
},
|
|
"valid": {
|
|
"type": "boolean"
|
|
},
|
|
"latitude": {
|
|
"type": "number"
|
|
},
|
|
"longitude": {
|
|
"type": "number"
|
|
},
|
|
"altitude": {
|
|
"type": "number"
|
|
},
|
|
"speed": {
|
|
"type": "number"
|
|
},
|
|
"course": {
|
|
"type": "number"
|
|
},
|
|
"address": {
|
|
"type": "string"
|
|
},
|
|
"attributes": {}
|
|
}
|
|
},
|
|
"User": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"readonly": {
|
|
"type": "boolean"
|
|
},
|
|
"admin": {
|
|
"type": "boolean"
|
|
},
|
|
"map": {
|
|
"type": "string"
|
|
},
|
|
"distanceUnit": {
|
|
"type": "string"
|
|
},
|
|
"speedUnit": {
|
|
"type": "string"
|
|
},
|
|
"latitude": {
|
|
"type": "number"
|
|
},
|
|
"longitude": {
|
|
"type": "number"
|
|
},
|
|
"zoom": {
|
|
"type": "integer"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"twelveHourFormat": {
|
|
"type": "boolean"
|
|
},
|
|
"coordinateFormat": {
|
|
"type": "string"
|
|
},
|
|
"disabled": {
|
|
"type": "boolean"
|
|
},
|
|
"expirationTime": {
|
|
"type": "string"
|
|
},
|
|
"deviceLimit": {
|
|
"type": "integer"
|
|
},
|
|
"token": {
|
|
"type": "string"
|
|
},
|
|
"attributes": {}
|
|
}
|
|
},
|
|
"Server": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"registration": {
|
|
"type": "boolean"
|
|
},
|
|
"readonly": {
|
|
"type": "boolean"
|
|
},
|
|
"map": {
|
|
"type": "string"
|
|
},
|
|
"bingKey": {
|
|
"type": "string"
|
|
},
|
|
"mapUrl": {
|
|
"type": "string"
|
|
},
|
|
"distanceUnit": {
|
|
"type": "string"
|
|
},
|
|
"speedUnit": {
|
|
"type": "string"
|
|
},
|
|
"latitude": {
|
|
"type": "number"
|
|
},
|
|
"longitude": {
|
|
"type": "number"
|
|
},
|
|
"zoom": {
|
|
"type": "integer"
|
|
},
|
|
"twelveHourFormat": {
|
|
"type": "boolean"
|
|
},
|
|
"version": {
|
|
"type": "string"
|
|
},
|
|
"forceSettings": {
|
|
"type": "boolean"
|
|
},
|
|
"coordinateFormat": {
|
|
"type": "string"
|
|
},
|
|
"attributes": {}
|
|
}
|
|
},
|
|
"Command": {
|
|
"properties": {
|
|
"deviceId": {
|
|
"type": "integer"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"attributes": {}
|
|
}
|
|
},
|
|
"Device": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"uniqueId": {
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"lastUpdate": {
|
|
"type": "string"
|
|
},
|
|
"positionId": {
|
|
"type": "integer"
|
|
},
|
|
"groupId": {
|
|
"type": "integer"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
},
|
|
"model": {
|
|
"type": "string"
|
|
},
|
|
"contact": {
|
|
"type": "string"
|
|
},
|
|
"category": {
|
|
"type": "string"
|
|
},
|
|
"geofenceIds": {},
|
|
"attributes": {}
|
|
}
|
|
},
|
|
"Group": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"groupId": {
|
|
"type": "integer"
|
|
},
|
|
"attributes": {}
|
|
}
|
|
},
|
|
"DevicePermission": {
|
|
"properties": {
|
|
"userId": {
|
|
"type": "integer"
|
|
},
|
|
"deviceId": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"GroupPermission": {
|
|
"properties": {
|
|
"userId": {
|
|
"type": "integer"
|
|
},
|
|
"groupId": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"GeofencePermission": {
|
|
"properties": {
|
|
"userId": {
|
|
"type": "integer"
|
|
},
|
|
"geofenceId": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"GroupGeofence": {
|
|
"properties": {
|
|
"groupId": {
|
|
"type": "integer"
|
|
},
|
|
"geofenceId": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"DeviceGeofence": {
|
|
"properties": {
|
|
"deviceId": {
|
|
"type": "integer"
|
|
},
|
|
"geofenceId": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"CommandType": {
|
|
"properties": {
|
|
"type": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Geofence": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"area": {
|
|
"type": "string"
|
|
},
|
|
"attributes": {}
|
|
}
|
|
},
|
|
"Notification": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"userId": {
|
|
"type": "integer"
|
|
},
|
|
"attributes": {}
|
|
}
|
|
},
|
|
"Event": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"serverTime": {
|
|
"type": "string"
|
|
},
|
|
"deviceId": {
|
|
"type": "integer"
|
|
},
|
|
"positionId": {
|
|
"type": "integer"
|
|
},
|
|
"geofenceId": {
|
|
"type": "integer"
|
|
},
|
|
"attributes": {}
|
|
}
|
|
},
|
|
"ReportSummary": {
|
|
"properties": {
|
|
"deviceId": {
|
|
"type": "integer"
|
|
},
|
|
"deviceName": {
|
|
"type": "string"
|
|
},
|
|
"maxSpeed": {
|
|
"type": "number"
|
|
},
|
|
"averageSpeed": {
|
|
"type": "number"
|
|
},
|
|
"distance": {
|
|
"type": "number"
|
|
},
|
|
"engineHours": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"ReportTrips": {
|
|
"properties": {
|
|
"deviceId": {
|
|
"type": "integer"
|
|
},
|
|
"deviceName": {
|
|
"type": "string"
|
|
},
|
|
"maxSpeed": {
|
|
"type": "number"
|
|
},
|
|
"averageSpeed": {
|
|
"type": "number"
|
|
},
|
|
"distance": {
|
|
"type": "number"
|
|
},
|
|
"duration": {
|
|
"type": "integer"
|
|
},
|
|
"startTime": {
|
|
"type": "string"
|
|
},
|
|
"startAddress": {
|
|
"type": "string"
|
|
},
|
|
"startLat": {
|
|
"type": "number"
|
|
},
|
|
"startLon": {
|
|
"type": "number"
|
|
},
|
|
"endTime": {
|
|
"type": "string"
|
|
},
|
|
"endAddress": {
|
|
"type": "string"
|
|
},
|
|
"endLat": {
|
|
"type": "number"
|
|
},
|
|
"endLon": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
},
|
|
"Statistics": {
|
|
"properties": {
|
|
"captureTime": {
|
|
"type": "string"
|
|
},
|
|
"activeUsers": {
|
|
"type": "integer"
|
|
},
|
|
"activeDevices": {
|
|
"type": "integer"
|
|
},
|
|
"requests": {
|
|
"type": "integer"
|
|
},
|
|
"messagesReceived": {
|
|
"type": "integer"
|
|
},
|
|
"messagesStored": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"AttributeAlias": {
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"deviceId": {
|
|
"type": "integer"
|
|
},
|
|
"attribute": {
|
|
"type": "string"
|
|
},
|
|
"alias": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"DeviceTotalDistance": {
|
|
"properties": {
|
|
"deviceId": {
|
|
"type": "integer"
|
|
},
|
|
"totalDistance": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|