{ "swagger": "2.0", "info": { "version": "3.5", "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": {} } } } }, "/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": {} } } } }, "/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": {} } } } }, "/positions": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "deviceId", "in": "query", "required": true, "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" } } } } } }, "/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/Position" } } } } }, "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": {} } } } } }, "definitions": { "Position": { "properties": { "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" } } }, "User": { "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "email": { "type": "string" }, "readonly": { "type": "boolean" }, "admin": { "type": "boolean" }, "map": { "type": "string" }, "language": { "type": "string" }, "distanceUnit": { "type": "string" }, "speedUnit": { "type": "string" }, "latitude": { "type": "number" }, "longitude": { "type": "number" }, "zoom": { "type": "number" }, "password": { "type": "string" }, "twelveHourFormat": { "type": "boolean" } } }, "Server": { "properties": { "id": { "type": "number" }, "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": "number" }, "twelveHourFormat": { "type": "boolean" } } }, "Command": { "properties": {} }, "Device": { "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "uniqueId": { "type": "string" }, "status": { "type": "string" }, "lastUpdate": { "type": "string" }, "positionId": { "type": "number" }, "groupId": { "type": "number" } } }, "Group": { "properties": { "id": { "type": "number" }, "name": { "type": "string" }, "groupId": { "type": "number" } } }, "DevicePermission": { "properties": { "userId": { "type": "number" }, "deviceId": { "type": "number" } } }, "GroupPermission": { "properties": { "userId": { "type": "number" }, "groupId": { "type": "number" } } } } }