diff options
author | Abyss777 <abyss@fox5.ru> | 2017-09-19 10:42:07 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-09-19 14:46:54 +0500 |
commit | 9519b653a8cef055366b0903fdd371c8f86d1206 (patch) | |
tree | 330fe6bb9ee1fe45330979f16f16e204e1437447 /swagger.json | |
parent | c82fd979ad17ecfb7dd8f3e366c067b66f4cdabc (diff) | |
download | trackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.tar.gz trackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.tar.bz2 trackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.zip |
Implement per device Notifications
Diffstat (limited to 'swagger.json')
-rw-r--r-- | swagger.json | 110 |
1 files changed, 97 insertions, 13 deletions
diff --git a/swagger.json b/swagger.json index 762ef3525..5f9abb9b8 100644 --- a/swagger.json +++ b/swagger.json @@ -627,19 +627,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": { @@ -655,16 +661,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": { @@ -674,6 +696,50 @@ } } } + }, + "delete": { + "summary": "Delete a Notification", + "parameters": [ + { + "$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/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 if sending has failed" + } + } } }, "/commandtypes": { @@ -1604,8 +1670,8 @@ "type": { "type": "string" }, - "userId": { - "type": "integer" + "always": { + "type": "boolean" }, "web": { "type": "boolean" @@ -1613,9 +1679,19 @@ "mail": { "type": "boolean" }, + "sms": { + "type": "boolean" + }, "attributes": {} } }, + "NotificationType": { + "properties": { + "type": { + "type": "string" + } + } + }, "Event": { "properties": { "id": { @@ -1966,6 +2042,14 @@ "$ref": "#/definitions/Command" } }, + "Notification": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Notification" + } + }, "deviceIdArray": { "name": "deviceId", "in": "query", |