{ "openapi": "3.1.0", "info": { "title": "User status", "version": "1.4.0", "description": "User status", "license": { "name": "agpl", "identifier": " AGPL-3.0" } }, "servers": [ { "url": "https://{hostname}:{port}", "variables": { "hostname": { "default": "localhost" }, "port": { "default": "8080" } } } ], "security": [ { "basic_auth": [] } ], "tags": [ { "name": "user_status" } ], "components": { "schemas": { "OCSMeta": { "type": "object", "properties": { "status": { "type": "string" }, "statuscode": { "type": "integer" }, "message": { "type": "string" }, "totalitems": { "type": "string" }, "itemsperpage": { "type": "string" } } }, "UserStatusPredefinedStatuses": { "type": "object", "properties": { "ocs": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/UserStatusPredefinedStatus" } } } } } }, "UserStatusPredefinedStatus": { "type": "object", "properties": { "id": { "type": "string" }, "icon": { "type": "string" }, "message": { "type": "string" }, "clearAt": { "$ref": "#/components/schemas/UserStatusClearAtWrap" } } }, "UserStatusClearAtWrap": { "oneOf": [ { "$ref": "#/components/schemas/UserStatusClearAt" }, { "type": "integer", "description": "Time as unix timestamp" } ] }, "UserStatusClearAt": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "period", "end-of" ] }, "time": { "oneOf": [ { "type": "string", "enum": [ "day", "week" ] }, { "type": "integer", "description": "Time offset in seconds" } ] } } }, "UserStatusType": { "type": "string", "enum": [ "online", "offline", "dnd", "away", "invisible" ] }, "UserStatusGetUserStatus": { "type": "object", "properties": { "ocs": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "anyOf": [ { "$ref": "#/components/schemas/UserStatus" } ] } } } } }, "UserStatusFindAllStatuses": { "type": "object", "properties": { "ocs": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/UserStatusPublicUserStatus" } } } } } }, "UserStatusFindStatus": { "type": "object", "properties": { "ocs": { "type": "object", "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "anyOf": [ { "$ref": "#/components/schemas/UserStatusPublicUserStatus" } ] } } } } }, "UserStatus": { "type": "object", "properties": { "userId": { "type": "string" }, "message": { "type": "string" }, "messageId": { "type": "string" }, "messageIsPredefined": { "type": "boolean" }, "icon": { "type": "string" }, "clearAt": { "$ref": "#/components/schemas/UserStatusClearAtWrap" }, "status": { "$ref": "#/components/schemas/UserStatusType" }, "statusIsUserDefined": { "type": "boolean" } } }, "UserStatusPublicUserStatus": { "type": "object", "properties": { "userId": { "type": "string" }, "message": { "type": "string" }, "icon": { "type": "string" }, "clearAt": { "$ref": "#/components/schemas/UserStatusClearAtWrap" }, "status": { "$ref": "#/components/schemas/UserStatusType" } } } }, "securitySchemes": { "basic_auth": { "type": "http", "scheme": "basic" } } }, "paths": { "/ocs/v1.php/apps/user_status/api/v1/statuses": { "get": { "operationId": "find-all-statuses", "tags": [ "user_status" ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserStatusFindAllStatuses" } } } } } } }, "/ocs/v1.php/apps/user_status/api/v1/statuses/{userId}": { "parameters": [ { "name": "userId", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "operationId": "find-status", "tags": [ "user_status" ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserStatusFindStatus" } } } } } } }, "/ocs/v1.php/apps/user_status/api/v1/user_status": { "get": { "operationId": "get-status", "tags": [ "user_status" ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserStatusGetUserStatus" } } } } } } }, "/ocs/v1.php/apps/user_status/api/v1/user_status/status": { "put": { "operationId": "set-status", "tags": [ "user_status" ], "parameters": [ { "name": "statusType", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/UserStatusType" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserStatusGetUserStatus" } } } } } } }, "/ocs/v1.php/apps/user_status/api/v1/user_status/message/predefined": { "put": { "operationId": "set-predefined-message", "tags": [ "user_status" ], "parameters": [ { "name": "messageId", "in": "query", "required": true, "schema": { "type": "string" } }, { "name": "clearAt", "in": "query", "required": false, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserStatusGetUserStatus" } } } } } } }, "/ocs/v1.php/apps/user_status/api/v1/user_status/message/custom": { "put": { "operationId": "set-custom-message", "tags": [ "user_status" ], "parameters": [ { "name": "statusIcon", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "message", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "clearAt", "in": "query", "required": false, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserStatusGetUserStatus" } } } } } } }, "/ocs/v1.php/apps/user_status/api/v1/user_status/message": { "delete": { "operationId": "clear-message", "tags": [ "user_status" ], "responses": { "200": { "description": "" } } } }, "/ocs/v1.php/apps/user_status/api/v1/predefined_statuses": { "get": { "operationId": "find-all-predefined-statuses", "tags": [ "user_status" ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserStatusPredefinedStatuses" } } } } } } }, "/ocs/v1.php/apps/user_status/api/v1/heartbeat": { "description": "Depends on https://github.com/nextcloud/server/pull/32646", "put": { "operationId": "heartbeat", "tags": [ "user_status" ], "parameters": [ { "name": "status", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/UserStatusType" } } ], "responses": { "200": { "description": "" } } } } } }