378 строки
15 KiB
JSON
378 строки
15 KiB
JSON
{
|
|
"openapi": "3.0.3",
|
|
"info": {
|
|
"title": "notifications-administration",
|
|
"version": "0.0.1",
|
|
"description": "This app provides a backend and frontend for the notification API available in Nextcloud.",
|
|
"license": {
|
|
"name": "agpl"
|
|
}
|
|
},
|
|
"components": {
|
|
"securitySchemes": {
|
|
"basic_auth": {
|
|
"type": "http",
|
|
"scheme": "basic"
|
|
},
|
|
"bearer_auth": {
|
|
"type": "http",
|
|
"scheme": "bearer"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"Capabilities": {
|
|
"type": "object",
|
|
"required": [
|
|
"notifications"
|
|
],
|
|
"properties": {
|
|
"notifications": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs-endpoints",
|
|
"push",
|
|
"admin-notifications"
|
|
],
|
|
"properties": {
|
|
"ocs-endpoints": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"push": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"admin-notifications": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"OCSMeta": {
|
|
"type": "object",
|
|
"required": [
|
|
"status",
|
|
"statuscode"
|
|
],
|
|
"properties": {
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"statuscode": {
|
|
"type": "integer"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"totalitems": {
|
|
"type": "string"
|
|
},
|
|
"itemsperpage": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"paths": {
|
|
"/ocs/v2.php/apps/notifications/api/{apiVersion}/admin_notifications/{userId}": {
|
|
"post": {
|
|
"operationId": "api-generate-notification",
|
|
"summary": "Generate a notification for a user",
|
|
"description": "This endpoint requires admin access",
|
|
"tags": [
|
|
"api"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearer_auth": []
|
|
},
|
|
{
|
|
"basic_auth": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "shortMessage",
|
|
"in": "query",
|
|
"description": "Subject of the notification",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "longMessage",
|
|
"in": "query",
|
|
"description": "Message of the notification",
|
|
"schema": {
|
|
"type": "string",
|
|
"default": ""
|
|
}
|
|
},
|
|
{
|
|
"name": "apiVersion",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": [
|
|
"v1",
|
|
"v2"
|
|
],
|
|
"default": "v2"
|
|
}
|
|
},
|
|
{
|
|
"name": "userId",
|
|
"in": "path",
|
|
"description": "ID of the user",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "OCS-APIRequest",
|
|
"in": "header",
|
|
"description": "Required to be true for the API request to pass",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": true
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Notification generated successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Generating notification is not possible",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {
|
|
"nullable": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "User not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {
|
|
"nullable": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {
|
|
"nullable": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/ocs/v2.php/apps/notifications/api/{apiVersion}/settings/admin": {
|
|
"post": {
|
|
"operationId": "settings-admin",
|
|
"summary": "Update default notification settings for new users",
|
|
"description": "This endpoint requires admin access",
|
|
"tags": [
|
|
"settings"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearer_auth": []
|
|
},
|
|
{
|
|
"basic_auth": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "batchSetting",
|
|
"in": "query",
|
|
"description": "How often E-mails about missed notifications should be sent (hourly: 1; every three hours: 2; daily: 3; weekly: 4)",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
},
|
|
{
|
|
"name": "soundNotification",
|
|
"in": "query",
|
|
"description": "Enable sound for notifications ('yes' or 'no')",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "soundTalk",
|
|
"in": "query",
|
|
"description": "Enable sound for Talk notifications ('yes' or 'no')",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "apiVersion",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": [
|
|
"v2"
|
|
],
|
|
"default": "v2"
|
|
}
|
|
},
|
|
{
|
|
"name": "OCS-APIRequest",
|
|
"in": "header",
|
|
"description": "Required to be true for the API request to pass",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": true
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Admin settings updated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": []
|
|
} |