diff options
author | Ivan Muratov <binakot@gmail.com> | 2017-10-24 14:52:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-24 14:52:48 +0300 |
commit | db02157dbb29539dda4b51a5e8b317293cfc536c (patch) | |
tree | b974f082172406e16a92cb9da8136ef856f571a5 /swagger.json | |
parent | 09d3cf2b5416327700ad22b652cf4a0dca09aaf2 (diff) | |
parent | 96e15853b9c28bd31295ca2c014e226e4a50aaa1 (diff) | |
download | trackermap-server-db02157dbb29539dda4b51a5e8b317293cfc536c.tar.gz trackermap-server-db02157dbb29539dda4b51a5e8b317293cfc536c.tar.bz2 trackermap-server-db02157dbb29539dda4b51a5e8b317293cfc536c.zip |
Merge branch 'master' into master
Diffstat (limited to 'swagger.json')
-rw-r--r-- | swagger.json | 887 |
1 files changed, 531 insertions, 356 deletions
diff --git a/swagger.json b/swagger.json index 734e42eab..82f34ac1d 100644 --- a/swagger.json +++ b/swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "3.10", + "version": "3.14", "title": "traccar" }, "host": "demo.traccar.org", @@ -22,35 +22,9 @@ ], "paths": { "/commands": { - "post": { - "summary": "Dispatch commands to device", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Command" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Command" - } - }, - "400": { - "description": "Could happen when dispatching to a device that is offline, the user doesn't have permission or an incorrect command _type_ for the device" - } - } - } - }, - "/devices": { "get": { - "summary": "Fetch a list of Devices", - "description": "Without any params, returns a list of the user's devices", + "summary": "Fetch a list of Saved Commands", + "description": "Without params, it returns a list of Drivers the user has access to", "parameters": [ { "$ref": "#/parameters/all" @@ -59,12 +33,13 @@ "$ref": "#/parameters/userId" }, { - "name" : "id", - "in" : "query", - "description" : "To fetch one or more devices. Multiple params can be passed like `id=31&id=42`", - "required" : false, - "type" : "integer", - "collectionFormat" : "multi" + "$ref": "#/parameters/deviceId" + }, + { + "$ref": "#/parameters/groupId" + }, + { + "$ref": "#/parameters/refresh" } ], "responses": { @@ -73,54 +48,51 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/Device" + "$ref": "#/definitions/Command" } } - }, - "400": { - "description": "No permission" } } }, "post": { - "summary": "Create a Device", + "summary": "Create a Saved Command", "parameters": [ { - "$ref": "#/parameters/Device" + "$ref": "#/parameters/Command" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Device" + "$ref": "#/definitions/Command" } } } } }, - "/devices/{id}": { + "/commands/{id}": { "put": { - "summary": "Update a Device", + "summary": "Update a Saved Command", "parameters": [ { "$ref": "#/parameters/entityId" }, { - "$ref": "#/parameters/Device" + "$ref": "#/parameters/Command" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Device" + "$ref": "#/definitions/Command" } } } }, "delete": { - "summary": "Delete a Device", + "summary": "Delete a Saved Command", "parameters": [ { "$ref": "#/parameters/entityId" @@ -133,70 +105,119 @@ } } }, - "/devices/{id}/distance": { - "put": { - "summary": "Update the distance counter of the Device", + "/commands/send": { + "get": { + "summary": "Fetch a list of Saved Commands supported by Device at the moment", + "description": "Return a list of saved commands linked to Device and its groups, filtered by current Device protocol support", "parameters": [ { - "$ref": "#/parameters/entityId" + "$ref": "#/parameters/deviceId" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Command" + } + } }, + "400": { + "description": "Could happen when the user doesn't have permission for the device" + } + } + }, + "post": { + "summary": "Dispatch commands to device", + "description": "Dispatch a new command or Saved Command if _body.id_ set", + "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DeviceTotalDistance" + "$ref": "#/definitions/Command" } } ], "responses": { - "204": { - "description": "No Content" + "200": { + "description": "Command sent", + "schema": { + "$ref": "#/definitions/Command" + } + }, + "202": { + "description": "Command queued", + "schema": { + "$ref": "#/definitions/Command" + } + }, + "400": { + "description": "Could happen when the user doesn't have permission or an incorrect command _type_ for the device" } } } }, - "/devices/geofences": { - "post": { - "summary": "Link a Geofence to a Device", + "/commands/types": { + "get": { + "summary": "Fetch a list of available Commands for the Device or all possible Commands if Device ommited", "parameters": [ { - "$ref": "#/parameters/DeviceGeofence" + "name": "deviceId", + "in": "query", + "type": "integer" + }, + { + "name": "textChannel", + "in": "query", + "type": "boolean" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/DeviceGeofence" + "type": "array", + "items": { + "$ref": "#/definitions/CommandType" + } } - } - } - }, - "delete": { - "summary": "Remove a Geofence from a Device", - "parameters": [ - { - "$ref": "#/parameters/DeviceGeofence" - } - ], - "responses": { - "204": { - "description": "No Content" + }, + "400": { + "description": "Could happen when trying to fetch from a device the user does not have permission" } } } }, - "/groups": { + "/devices": { "get": { - "summary": "Fetch a list of Groups", - "description": "Without any params, returns a list of the Groups the user belongs to", + "summary": "Fetch a list of Devices", + "description": "Without any params, returns a list of the user's devices", "parameters": [ { "$ref": "#/parameters/all" }, { "$ref": "#/parameters/userId" + }, + { + "name" : "id", + "in" : "query", + "description" : "To fetch one or more devices. Multiple params can be passed like `id=31&id=42`", + "required" : false, + "type" : "integer", + "collectionFormat" : "multi" + }, + { + "name" : "uniqueId", + "in" : "query", + "description" : "To fetch one or more devices. Multiple params can be passed like `uniqueId=333331&uniqieId=44442`", + "required" : false, + "type" : "string", + "collectionFormat" : "multi" } ], "responses": { @@ -205,54 +226,54 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/Group" + "$ref": "#/definitions/Device" } } + }, + "400": { + "description": "No permission" } } }, "post": { - "summary": "Create a Group", + "summary": "Create a Device", "parameters": [ { - "$ref": "#/parameters/Group" + "$ref": "#/parameters/Device" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Group" + "$ref": "#/definitions/Device" } - }, - "400": { - "description": "No permission" } } } }, - "/groups/{id}": { + "/devices/{id}": { "put": { - "summary": "Update a Group", + "summary": "Update a Device", "parameters": [ { "$ref": "#/parameters/entityId" }, { - "$ref": "#/parameters/Group" + "$ref": "#/parameters/Device" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Group" + "$ref": "#/definitions/Device" } } } }, "delete": { - "summary": "Delete a Group", + "summary": "Delete a Device", "parameters": [ { "$ref": "#/parameters/entityId" @@ -265,29 +286,21 @@ } } }, - "/groups/geofences": { - "post": { - "summary": "Link a Geofence to a Group", + "/devices/{id}/distance": { + "put": { + "summary": "Update the distance counter of the Device", "parameters": [ { - "$ref": "#/parameters/GroupGeofence" - } - ], - "responses": { - "200": { - "description": "OK", + "$ref": "#/parameters/entityId" + }, + { + "name": "body", + "in": "body", + "required": true, "schema": { - "$ref": "#/definitions/GroupGeofence" + "$ref": "#/definitions/DeviceTotalDistance" } } - } - }, - "delete": { - "summary": "Remove a Geofence from a Group", - "parameters": [ - { - "$ref": "#/parameters/GroupGeofence" - } ], "responses": { "204": { @@ -296,124 +309,75 @@ } } }, - "/permissions/devices": { - "post": { - "summary": "Link a Device to a User", + "/groups": { + "get": { + "summary": "Fetch a list of Groups", + "description": "Without any params, returns a list of the Groups the user belongs to", "parameters": [ { - "$ref": "#/parameters/DevicePermission" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/DevicePermission" - } + "$ref": "#/parameters/all" }, - "400": { - "description": "No permission" - } - } - }, - "delete": { - "summary": "Remove a Device from a User", - "parameters": [ { - "$ref": "#/parameters/DevicePermission" - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - } - }, - "/permissions/groups": { - "post": { - "summary": "Link a Group to a User", - "parameters": [ - { - "$ref": "#/parameters/GroupPermission" + "$ref": "#/parameters/userId" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/GroupPermission" + "type": "array", + "items": { + "$ref": "#/definitions/Group" + } } } } }, - "delete": { - "summary": "Remove a Group from a User", - "parameters": [ - { - "$ref": "#/parameters/GroupPermission" - } - ], - "responses": { - "204": { - "description": "No Content" - } - } - } - }, - "/permissions/geofences": { "post": { - "summary": "Link a Geofence to a User", + "summary": "Create a Group", "parameters": [ { - "$ref": "#/parameters/GeofencePermission" + "$ref": "#/parameters/Group" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/GeofencePermission" + "$ref": "#/definitions/Group" } - } - } - }, - "delete": { - "summary": "Remove a Geofence from a User", - "parameters": [ - { - "$ref": "#/parameters/GeofencePermission" - } - ], - "responses": { - "204": { - "description": "No Content" + }, + "400": { + "description": "No permission" } } } }, - "/permissions/calendars": { - "post": { - "summary": "Link a Calendar to a User", + "/groups/{id}": { + "put": { + "summary": "Update a Group", "parameters": [ { - "$ref": "#/parameters/CalendarPermission" + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Group" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/CalendarPermission" + "$ref": "#/definitions/Group" } } } }, "delete": { - "summary": "Remove a Calendar from a User", + "summary": "Delete a Group", "parameters": [ { - "$ref": "#/parameters/CalendarPermission" + "$ref": "#/parameters/entityId" } ], "responses": { @@ -423,28 +387,31 @@ } } }, - "/permissions/users": { + "/permissions": { "post": { - "summary": "Link a User to a manager User", + "summary": "Link an Object to another Object", "parameters": [ { - "$ref": "#/parameters/UserPermission" + "$ref": "#/parameters/Permission" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/UserPermission" + "$ref": "#/definitions/Permission" } + }, + "400": { + "description": "No permission" } } }, "delete": { - "summary": "Remove a User from a manager User", + "summary": "Unlink an Object from another Object", "parameters": [ { - "$ref": "#/parameters/UserPermission" + "$ref": "#/parameters/Permission" } ], "responses": { @@ -697,19 +664,25 @@ } } }, - "/users/notifications": { + "/notifications": { "get": { - "summary": "Fetch a list of Notification types", - "description": "Without params, it returns a list of the user's enabled Notifications", + "summary": "Fetch a list of Notifications", + "description": "Without params, it returns a list of Notifications the user has access to", "parameters": [ { - "name": "all", - "in": "query", - "description": "To fetch a list of all available Notifications", - "type": "boolean" + "$ref": "#/parameters/all" }, { "$ref": "#/parameters/userId" + }, + { + "$ref": "#/parameters/deviceId" + }, + { + "$ref": "#/parameters/groupId" + }, + { + "$ref": "#/parameters/refresh" } ], "responses": { @@ -725,16 +698,32 @@ } }, "post": { - "summary": "Set or unset a Notification", + "summary": "Create a Notification", "parameters": [ { - "name": "body", - "in": "body", - "required": true, + "$ref": "#/parameters/Notification" + } + ], + "responses": { + "200": { + "description": "OK", "schema": { "$ref": "#/definitions/Notification" } } + } + } + }, + "/notifications/{id}": { + "put": { + "summary": "Update a Notification", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Notification" + } ], "responses": { "200": { @@ -744,31 +733,48 @@ } } } - } - }, - "/commandtypes": { - "get": { - "summary": "Fetch a list of available Commands for the Device", + }, + "delete": { + "summary": "Delete a Notification", "parameters": [ { - "name": "deviceId", - "in": "query", - "required": true, - "type": "integer" + "$ref": "#/parameters/entityId" } ], "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/notifications/types": { + "get": { + "summary": "Fetch a list of available Notification types", + "parameters": [], + "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { - "$ref": "#/definitions/CommandType" + "$ref": "#/definitions/NotificationType" } } + } + } + } + }, + "/notifications/test": { + "post": { + "summary": "Send test notification to current user via Email and SMS", + "parameters": [], + "responses": { + "204": { + "description": "Successful sending" }, "400": { - "description": "Could happen when trying to fetch from an offline device or the user does not have permission" + "description": "Could happen if sending has failed" } } } @@ -785,18 +791,13 @@ "$ref": "#/parameters/userId" }, { - "name": "groupId", - "in": "query", - "type": "integer" + "$ref": "#/parameters/deviceId" }, { - "$ref": "#/parameters/deviceId" + "$ref": "#/parameters/groupId" }, { - "name": "refresh", - "in": "query", - "required": false, - "type": "boolean" + "$ref": "#/parameters/refresh" } ], "responses": { @@ -1044,6 +1045,45 @@ } } }, + "/reports/stops": { + "get": { + "summary": "Fetch a list of ReportStops within the time period for the Devices or Groups", + "description": "At least one _deviceId_ or one _groupId_ must be passed", + "consumes": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "produces": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "parameters": [ + { + "$ref": "#/parameters/deviceIdArray" + }, + { + "$ref": "#/parameters/groupIdArray" + }, + { + "$ref": "#/parameters/fromTime" + }, + { + "$ref": "#/parameters/toTime" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ReportStops" + } + } + } + } + } + }, "/statistics": { "get": { "summary": "Fetch server Statistics", @@ -1068,13 +1108,100 @@ } } }, - "/attributes/aliases": { + "/calendars": { "get": { - "summary": "Fetch a list of AttributeAlias", - "description": "Without params, it returns a list of AttributeAlias from all the user's Devices", + "summary": "Fetch a list of Calendars", + "description": "Without params, it returns a list of Calendars the user has access to", "parameters": [ { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Calendar" + } + } + } + } + }, + "post": { + "summary": "Create a Calendar", + "parameters": [ + { + "$ref": "#/parameters/Calendar" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Calendar" + } + } + } + } + }, + "/calendars/{id}": { + "put": { + "summary": "Update a Calendar", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Calendar" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Calendar" + } + } + } + }, + "delete": { + "summary": "Delete a Calendar", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/attributes/computed": { + "get": { + "summary": "Fetch a list of Attributes", + "description": "Without params, it returns a list of Attributes the user has access to", + "parameters": [ + { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + }, + { "$ref": "#/parameters/deviceId" + }, + { + "$ref": "#/parameters/groupId" + }, + { + "$ref": "#/parameters/refresh" } ], "responses": { @@ -1083,51 +1210,51 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/AttributeAlias" + "$ref": "#/definitions/Attribute" } } } } }, "post": { - "summary": "Set an AttributeAlias", + "summary": "Create an Attribute", "parameters": [ { - "$ref": "#/parameters/AttributeAlias" + "$ref": "#/parameters/Attribute" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/AttributeAlias" + "$ref": "#/definitions/Attribute" } } } } }, - "/attributes/aliases/{id}": { + "/attributes/computed/{id}": { "put": { - "summary": "Update an AttributeAlias", + "summary": "Update an Attribute", "parameters": [ { "$ref": "#/parameters/entityId" }, { - "$ref": "#/parameters/AttributeAlias" + "$ref": "#/parameters/Attribute" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/AttributeAlias" + "$ref": "#/definitions/Attribute" } } } }, "delete": { - "summary": "Delete an AttributeAlias", + "summary": "Delete an Attribute", "parameters": [ { "$ref": "#/parameters/entityId" @@ -1140,16 +1267,25 @@ } } }, - "/calendars": { + "/drivers": { "get": { - "summary": "Fetch a list of Calendars", - "description": "Without params, it returns a list of Calendars the user has access to", + "summary": "Fetch a list of Drivers", + "description": "Without params, it returns a list of Drivers the user has access to", "parameters": [ { "$ref": "#/parameters/all" }, { "$ref": "#/parameters/userId" + }, + { + "$ref": "#/parameters/deviceId" + }, + { + "$ref": "#/parameters/groupId" + }, + { + "$ref": "#/parameters/refresh" } ], "responses": { @@ -1158,51 +1294,51 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/Calendar" + "$ref": "#/definitions/Driver" } } } } }, "post": { - "summary": "Create a Calendar", + "summary": "Create a Driver", "parameters": [ { - "$ref": "#/parameters/Calendar" + "$ref": "#/parameters/Driver" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Calendar" + "$ref": "#/definitions/Driver" } } } } }, - "/calendars/{id}": { + "/drivers/{id}": { "put": { - "summary": "Update a Calendar", + "summary": "Update a Driver", "parameters": [ { "$ref": "#/parameters/entityId" }, { - "$ref": "#/parameters/Calendar" + "$ref": "#/parameters/Driver" } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/Calendar" + "$ref": "#/definitions/Driver" } } } }, "delete": { - "summary": "Delete a Calendar", + "summary": "Delete a Driver", "parameters": [ { "$ref": "#/parameters/entityId" @@ -1297,12 +1433,6 @@ "map": { "type": "string" }, - "distanceUnit": { - "type": "string" - }, - "speedUnit": { - "type": "string" - }, "latitude": { "type": "number" }, @@ -1338,6 +1468,9 @@ "deviceReadonly": { "type": "boolean" }, + "limitCommands": { + "type": "boolean" + }, "token": { "type": "string" }, @@ -1355,6 +1488,12 @@ "readonly": { "type": "boolean" }, + "deviceReadonly": { + "type": "boolean" + }, + "limitCommands": { + "type": "boolean" + }, "map": { "type": "string" }, @@ -1364,12 +1503,6 @@ "mapUrl": { "type": "string" }, - "distanceUnit": { - "type": "string" - }, - "speedUnit": { - "type": "string" - }, "latitude": { "type": "number" }, @@ -1396,9 +1529,15 @@ }, "Command": { "properties": { + "id": { + "type": "integer" + }, "deviceId": { "type": "integer" }, + "description": { + "type": "string" + }, "type": { "type": "string" }, @@ -1465,72 +1604,39 @@ "attributes": {} } }, - "DevicePermission": { + "Permission": { + "description": "This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }", "properties": { "userId": { + "description": "User Id, can be only first parameter", "type": "integer" }, "deviceId": { - "type": "integer" - } - } - }, - "GroupPermission": { - "properties": { - "userId": { + "description": "Device Id, can be first parameter or second only in combination with userId", "type": "integer" }, "groupId": { - "type": "integer" - } - } - }, - "GeofencePermission": { - "properties": { - "userId": { + "description": "Group Id, can be first parameter or second only in combination with userId", "type": "integer" }, "geofenceId": { - "type": "integer" - } - } - }, - "CalendarPermission": { - "properties": { - "userId": { + "description": "Geofence Id, can be second parameter only", "type": "integer" }, "calendarId": { - "type": "integer" - } - } - }, - "UserPermission": { - "properties": { - "userId": { + "description": "Geofence Id, can be second parameter only and only in combination with userId", "type": "integer" }, - "managedUserId": { - "type": "integer" - } - } - }, - "GroupGeofence": { - "properties": { - "groupId": { + "attributeId": { + "description": "Computed Attribute Id, can be second parameter only", "type": "integer" }, - "geofenceId": { - "type": "integer" - } - } - }, - "DeviceGeofence": { - "properties": { - "deviceId": { + "driverId": { + "description": "Driver Id, can be second parameter only", "type": "integer" }, - "geofenceId": { + "managedUserId": { + "description": "User Id, can be second parameter only and only in combination with userId", "type": "integer" } } @@ -1570,8 +1676,8 @@ "type": { "type": "string" }, - "userId": { - "type": "integer" + "always": { + "type": "boolean" }, "web": { "type": "boolean" @@ -1579,9 +1685,19 @@ "mail": { "type": "boolean" }, + "sms": { + "type": "boolean" + }, "attributes": {} } }, + "NotificationType": { + "properties": { + "type": { + "type": "string" + } + } + }, "Event": { "properties": { "id": { @@ -1627,6 +1743,10 @@ "type": "number", "description": "in meters" }, + "spentFuel": { + "type": "number", + "description": "in liters" + }, "engineHours": { "type": "integer" } @@ -1652,6 +1772,10 @@ "type": "number", "description": "in meters" }, + "spentFuel": { + "type": "number", + "description": "in liters" + }, "duration": { "type": "integer" }, @@ -1682,6 +1806,51 @@ }, "endLon": { "type": "number" + }, + "driverUniqueId": { + "type": "integer" + }, + "driverName": { + "type": "string" + } + } + }, + "ReportStops": { + "properties": { + "deviceId": { + "type": "integer" + }, + "deviceName": { + "type": "string" + }, + "duration": { + "type": "integer" + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "address": { + "type": "string" + }, + "lat": { + "type": "number" + }, + "lon": { + "type": "number" + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "spentFuel": { + "type": "number", + "description": "in liters" + }, + "engineHours": { + "type": "integer" } } }, @@ -1709,22 +1878,6 @@ } } }, - "AttributeAlias": { - "properties": { - "id": { - "type": "integer" - }, - "deviceId": { - "type": "integer" - }, - "attribute": { - "type": "string" - }, - "alias": { - "type": "string" - } - } - }, "DeviceTotalDistance": { "properties": { "deviceId": { @@ -1750,6 +1903,40 @@ }, "atributes": {} } + }, + "Attribute": { + "properties": { + "id": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "attribute": { + "type": "string" + }, + "expression": { + "type": "string" + }, + "type": { + "type": "string", + "description": "String|Number|Boolean" + } + } + }, + "Driver": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "uniqueId": { + "type": "string" + }, + "atributes": {} + } } }, "parameters": { @@ -1765,6 +1952,12 @@ "description": "Can only be used by admins or managers to fetch all entities", "type": "boolean" }, + "refresh": { + "name": "refresh", + "in": "query", + "required": false, + "type": "boolean" + }, "userId": { "name": "userId", "in": "query", @@ -1777,6 +1970,12 @@ "description": "Standard users can use this only with _deviceId_s, they have access to", "type": "integer" }, + "groupId": { + "name": "groupId", + "in": "query", + "description": "Standard users can use this only with _groupId_s, they have access to", + "type": "integer" + }, "Device": { "name": "body", "in": "body", @@ -1785,12 +1984,12 @@ "$ref": "#/definitions/Device" } }, - "DeviceGeofence": { + "Permission": { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DeviceGeofence" + "$ref": "#/definitions/Permission" } }, "Group": { @@ -1801,84 +2000,60 @@ "$ref": "#/definitions/Group" } }, - "GroupGeofence": { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GroupGeofence" - } - }, - "DevicePermission": { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DevicePermission" - } - }, - "GroupPermission": { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GroupPermission" - } - }, - "GeofencePermission": { + "User": { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/GeofencePermission" + "$ref": "#/definitions/User" } }, - "CalendarPermission": { + "Geofence": { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CalendarPermission" + "$ref": "#/definitions/Geofence" } }, - "UserPermission": { + "Calendar": { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/UserPermission" + "$ref": "#/definitions/Calendar" } }, - "User": { + "Attribute": { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/User" + "$ref": "#/definitions/Attribute" } }, - "Geofence": { + "Driver": { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Geofence" + "$ref": "#/definitions/Driver" } }, - "AttributeAlias": { + "Command": { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/AttributeAlias" + "$ref": "#/definitions/Command" } }, - "Calendar": { + "Notification": { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Calendar" + "$ref": "#/definitions/Notification" } }, "deviceIdArray": { |