aboutsummaryrefslogtreecommitdiff
path: root/swagger.json
diff options
context:
space:
mode:
Diffstat (limited to 'swagger.json')
-rw-r--r--swagger.json216
1 files changed, 197 insertions, 19 deletions
diff --git a/swagger.json b/swagger.json
index 82f34ac1d..bf62510c4 100644
--- a/swagger.json
+++ b/swagger.json
@@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
- "version": "3.14",
+ "version": "4.7",
"title": "traccar"
},
"host": "demo.traccar.org",
@@ -168,11 +168,22 @@
{
"name": "deviceId",
"in": "query",
+ "description" : "Internal device identifier. Only works if device has already reported some locations",
+ "required" : false,
"type": "integer"
},
{
+ "name": "protocol",
+ "in": "query",
+ "description" : "Protocol name. Can be used instead of device id",
+ "required" : false,
+ "type": "string"
+ },
+ {
"name": "textChannel",
"in": "query",
+ "description" : "When `true` return SMS commands. If not specified or `false` return data commands",
+ "required" : false,
"type": "boolean"
}
],
@@ -286,9 +297,9 @@
}
}
},
- "/devices/{id}/distance": {
+ "/devices/{id}/accumulators": {
"put": {
- "summary": "Update the distance counter of the Device",
+ "summary": "Update total distance and hours of the Device",
"parameters": [
{
"$ref": "#/parameters/entityId"
@@ -298,7 +309,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/DeviceTotalDistance"
+ "$ref": "#/definitions/DeviceAccumulators"
}
}
],
@@ -1350,6 +1361,90 @@
}
}
}
+ },
+ "/maintenance": {
+ "get": {
+ "summary": "Fetch a list of Maintenance",
+ "description": "Without params, it returns a list of Maintenance the user has access to",
+ "parameters": [
+ {
+ "$ref": "#/parameters/all"
+ },
+ {
+ "$ref": "#/parameters/userId"
+ },
+ {
+ "$ref": "#/parameters/deviceId"
+ },
+ {
+ "$ref": "#/parameters/groupId"
+ },
+ {
+ "$ref": "#/parameters/refresh"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Maintenance"
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "summary": "Create a Maintenance",
+ "parameters": [
+ {
+ "$ref": "#/parameters/Maintenance"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/Maintenance"
+ }
+ }
+ }
+ }
+ },
+ "/maintenance/{id}": {
+ "put": {
+ "summary": "Update a Maintenance",
+ "parameters": [
+ {
+ "$ref": "#/parameters/entityId"
+ },
+ {
+ "$ref": "#/parameters/Maintenance"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/Maintenance"
+ }
+ }
+ }
+ },
+ "delete": {
+ "summary": "Delete a Maintenance",
+ "parameters": [
+ {
+ "$ref": "#/parameters/entityId"
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "No Content"
+ }
+ }
+ }
}
},
"definitions": {
@@ -1408,9 +1503,13 @@
"type": "number"
},
"network": {
- "type": "string"
+ "type": "object",
+ "additionalProperties": true
},
- "attributes": {}
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
},
"User": {
@@ -1427,7 +1526,7 @@
"readonly": {
"type": "boolean"
},
- "admin": {
+ "administrator": {
"type": "boolean"
},
"map": {
@@ -1471,10 +1570,16 @@
"limitCommands": {
"type": "boolean"
},
+ "poiLayer": {
+ "type": "string"
+ },
"token": {
"type": "string"
},
- "attributes": {}
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
},
"Server": {
@@ -1503,6 +1608,9 @@
"mapUrl": {
"type": "string"
},
+ "poiLayer": {
+ "type": "string"
+ },
"latitude": {
"type": "number"
},
@@ -1524,7 +1632,10 @@
"coordinateFormat": {
"type": "string"
},
- "attributes": {}
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
},
"Command": {
@@ -1541,7 +1652,10 @@
"type": {
"type": "string"
},
- "attributes": {}
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
},
"Device": {
@@ -1558,6 +1672,9 @@
"status": {
"type": "string"
},
+ "disabled": {
+ "type": "boolean"
+ },
"lastUpdate": {
"type": "string",
"format": "date-time",
@@ -1587,7 +1704,10 @@
"type": "integer"
}
},
- "attributes": {}
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
},
"Group": {
@@ -1601,7 +1721,10 @@
"groupId": {
"type": "integer"
},
- "attributes": {}
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
},
"Permission": {
@@ -1624,7 +1747,7 @@
"type": "integer"
},
"calendarId": {
- "description": "Geofence Id, can be second parameter only and only in combination with userId",
+ "description": "Calendar Id, can be second parameter only and only in combination with userId",
"type": "integer"
},
"attributeId": {
@@ -1665,7 +1788,10 @@
"calendarId": {
"type": "integer"
},
- "attributes": {}
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
},
"Notification": {
@@ -1688,7 +1814,13 @@
"sms": {
"type": "boolean"
},
- "attributes": {}
+ "calendarId": {
+ "type": "integer"
+ },
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
},
"NotificationType": {
@@ -1720,7 +1852,13 @@
"geofenceId": {
"type": "integer"
},
- "attributes": {}
+ "maintenanceId": {
+ "type": "integer"
+ },
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
},
"ReportSummary": {
@@ -1878,7 +2016,7 @@
}
}
},
- "DeviceTotalDistance": {
+ "DeviceAccumulators": {
"properties": {
"deviceId": {
"type": "integer"
@@ -1886,6 +2024,9 @@
"totalDistance": {
"type": "number",
"description": "in meters"
+ },
+ "hours": {
+ "type": "number"
}
}
},
@@ -1901,7 +2042,10 @@
"type": "string",
"description": "base64 encoded in iCalendar format"
},
- "atributes": {}
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
},
"Attribute": {
@@ -1935,7 +2079,33 @@
"uniqueId": {
"type": "string"
},
- "atributes": {}
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ },
+ "Maintenance": {
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "start": {
+ "type": "number"
+ },
+ "period": {
+ "type": "number"
+ },
+ "attributes": {
+ "type": "object",
+ "additionalProperties": true
+ }
}
}
},
@@ -2056,6 +2226,14 @@
"$ref": "#/definitions/Notification"
}
},
+ "Maintenance": {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/Maintenance"
+ }
+ },
"deviceIdArray": {
"name": "deviceId",
"in": "query",