A framework for building convergent cross-platform Nextcloud clients using Flutter.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

545 lines
12 KiB

{
"openapi": "3.1.0",
"info": {
"title": "Notifications",
"version": "2.12.1",
"description": "This app provides a backend and frontend for the notification API available in Nextcloud.",
"license": {
"name": "agpl",
"identifier": " AGPL-3.0"
}
},
"servers": [
{
"url": "https://{hostname}:{port}",
"variables": {
"hostname": {
"default": "localhost"
},
"port": {
"default": "8080"
}
}
}
],
"security": [
{
"basic_auth": []
}
],
"tags": [
{
"name": "notifications"
}
],
"components": {
"schemas": {
"OCSMeta": {
"type": "object",
"required": [
"status",
"statuscode",
"totalitems",
"itemsperpage"
],
"properties": {
"status": {
"type": "string"
},
"statuscode": {
"type": "integer"
},
"message": {
"type": "string"
},
"totalitems": {
"type": "string"
},
"itemsperpage": {
"type": "string"
}
}
},
"NotificationsEmpty": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"NotificationsNotification": {
"type": "object",
"required": [
"notification_id",
"app",
"user",
"datetime",
"object_type",
"object_id",
"subject",
"message",
"link",
"subjectRich",
"subjectRichParameters",
"messageRich",
"messageRichParameters",
"icon",
"actions"
],
"properties": {
"notification_id": {
"type": "integer"
},
"app": {
"type": "string"
},
"user": {
"type": "string"
},
"datetime": {
"type": "string"
},
"object_type": {
"type": "string"
},
"object_id": {
"type": "string"
},
"subject": {
"type": "string"
},
"message": {
"type": "string"
},
"link": {
"type": "string"
},
"subjectRich": {
"type": "string"
},
"subjectRichParameters": {
"anyOf": [
{
"type": "object",
"properties": {}
}
]
},
"messageRich": {
"type": "string"
},
"messageRichParameters": {
"anyOf": [
{
"type": "object",
"properties": {}
}
]
},
"icon": {
"type": "string"
},
"actions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotificationsNotificationAction"
}
}
}
},
"NotificationsNotificationAction": {
"type": "object",
"required": [
"label",
"link",
"type"
],
"properties": {
"label": {
"type": "string"
},
"link": {
"type": "string"
},
"type": {
"type": "string"
},
"primary": {
"type": "boolean"
}
}
},
"NotificationsListNotifications": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotificationsNotification"
}
}
}
}
}
},
"NotificationsGetNotification": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"$ref": "#/components/schemas/NotificationsNotification"
}
}
}
}
},
"NotificationsPushServerSubscription": {
"type": "object",
"required": [
"publicKey",
"deviceIdentifier",
"signature"
],
"properties": {
"publicKey": {
"type": "string"
},
"deviceIdentifier": {
"type": "string"
},
"signature": {
"type": "string"
},
"message": {
"type": "string"
}
}
},
"NotificationsPushServerRegistration": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"$ref": "#/components/schemas/NotificationsPushServerSubscription"
}
}
}
}
},
"NotificationsPushNotification": {
"type": "object",
"required": [
"accountID",
"priority",
"type",
"subject"
],
"properties": {
"accountID": {
"type": "string"
},
"priority": {
"type": "string"
},
"type": {
"type": "string"
},
"subject": {
"$ref": "#/components/schemas/NotificationsPushNotificationDecryptedSubject"
}
}
},
"NotificationsPushNotificationDecryptedSubject": {
"type": "object",
"properties": {
"nid": {
"type": "integer"
},
"app": {
"type": "string"
},
"subject": {
"type": "string"
},
"type": {
"type": "string"
},
"id": {
"type": "string"
},
"delete": {
"type": "boolean"
},
"delete-all": {
"type": "boolean"
}
}
}
},
"securitySchemes": {
"basic_auth": {
"type": "http",
"scheme": "basic"
}
}
},
"paths": {
"/ocs/v1.php/apps/notifications/api/v2/notifications": {
"get": {
"operationId": "list-notifications",
"tags": [
"notifications"
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsListNotifications"
}
}
}
}
}
},
"delete": {
"operationId": "delete-all-notifications",
"tags": [
"notifications"
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
"/ocs/v1.php/apps/notifications/api/v2/notifications/{id}": {
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
}
],
"get": {
"operationId": "get-notification",
"tags": [
"notifications"
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsGetNotification"
}
}
}
}
}
},
"delete": {
"operationId": "delete-notification",
"tags": [
"notifications"
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsEmpty"
}
}
}
}
}
}
},
"/ocs/v1.php/apps/notifications/api/v2/push": {
"post": {
"operationId": "register-device",
"tags": [
"notifications"
],
"parameters": [
{
"name": "pushTokenHash",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "devicePublicKey",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "proxyServer",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "This URL has to end with a / otherwise the device will not be able to register"
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsPushServerRegistration"
}
}
}
}
}
},
"delete": {
"operationId": "remove-device",
"tags": [
"notifications"
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
"/ocs/v1.php/apps/notifications/api/v2/admin_notifications/{userId}": {
"parameters": [
{
"name": "userId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"post": {
"operationId": "send-admin-notification",
"tags": [
"notifications"
],
"parameters": [
{
"name": "shortMessage",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "longMessage",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": ""
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsEmpty"
}
}
}
}
}
}
}
}
}