{ "openapi": "3.0.3", "info": { "title": "polls", "version": "0.0.1", "description": "A polls app, similar to Doodle/DuD-Poll with the possibility to restrict access.", "license": { "name": "agpl" } }, "components": { "securitySchemes": { "basic_auth": { "type": "http", "scheme": "basic" }, "bearer_auth": { "type": "http", "scheme": "bearer" } }, "schemas": { "AbortedMailInfo": { "type": "object", "required": [ "emailAddress", "displayName", "reason" ], "properties": { "emailAddress": { "type": "string" }, "displayName": { "type": "string" }, "reason": { "type": "string" } } }, "AppPermissions": { "type": "object", "required": [ "allAccess", "addShares", "addSharesExternal", "changeForeignVotes", "comboView", "deanonymizePoll", "pollCreation", "pollDownload", "publicShares", "seeMailAddresses", "unrestrictedOwner" ], "properties": { "allAccess": { "type": "boolean" }, "addShares": { "type": "boolean" }, "addSharesExternal": { "type": "boolean" }, "changeForeignVotes": { "type": "boolean" }, "comboView": { "type": "boolean" }, "deanonymizePoll": { "type": "boolean" }, "pollCreation": { "type": "boolean" }, "pollDownload": { "type": "boolean" }, "publicShares": { "type": "boolean" }, "seeMailAddresses": { "type": "boolean" }, "unrestrictedOwner": { "type": "boolean" } } }, "AppSettings": { "type": "object", "required": [ "finalPrivacyUrl", "finalImprintUrl", "useLogin", "useActivity", "navigationPollsInList", "updateType", "currentVersion" ], "properties": { "finalPrivacyUrl": { "type": "string" }, "finalImprintUrl": { "type": "string" }, "useLogin": { "type": "boolean" }, "useActivity": { "type": "boolean" }, "navigationPollsInList": { "type": "boolean" }, "updateType": { "type": "string" }, "currentVersion": { "type": "string" } } }, "Capabilities": { "type": "object", "required": [ "polls" ], "properties": { "polls": { "$ref": "#/components/schemas/Capabilities" } } }, "Comment": { "type": "object", "required": [ "id", "pollId", "timestamp", "comment", "confidential", "parent", "deleted", "user", "recipient" ], "properties": { "id": { "type": "integer", "format": "int64" }, "pollId": { "type": "integer", "format": "int64" }, "timestamp": { "type": "integer", "format": "int64" }, "comment": { "type": "string", "nullable": true }, "confidential": { "type": "integer", "format": "int64" }, "parent": { "type": "integer", "format": "int64" }, "deleted": { "type": "integer", "format": "int64" }, "user": { "$ref": "#/components/schemas/User" }, "recipient": { "nullable": true, "allOf": [ { "$ref": "#/components/schemas/User" } ] } } }, "CurrentUserStatus": { "type": "object", "required": [ "userRole", "isLocked", "isInvolved", "isLoggedIn", "isNoUser", "isOwner", "userId", "orphanedVotes", "yesVotes", "noVotes", "maybeVotes", "countVotes", "shareToken", "groupInvitations", "pollGroupUserShares" ], "properties": { "userRole": { "type": "string" }, "isLocked": { "type": "boolean" }, "isInvolved": { "type": "boolean" }, "isLoggedIn": { "type": "boolean" }, "isNoUser": { "type": "boolean" }, "isOwner": { "type": "boolean" }, "userId": { "type": "string" }, "orphanedVotes": { "type": "integer", "format": "int64" }, "yesVotes": { "type": "integer", "format": "int64" }, "noVotes": { "type": "integer", "format": "int64" }, "maybeVotes": { "type": "integer", "format": "int64" }, "countVotes": { "type": "integer", "format": "int64" }, "shareToken": { "type": "string" }, "groupInvitations": { "type": "array", "items": { "type": "string" } }, "pollGroupUserShares": { "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" } } }, "Option": { "type": "object", "required": [ "id", "pollId", "text", "timestamp", "duration", "isoTimestamp", "isoDuration", "deleted", "order", "confirmed", "locked", "hash", "isOwner", "votes", "owner" ], "properties": { "id": { "type": "integer", "format": "int64" }, "pollId": { "type": "integer", "format": "int64" }, "text": { "type": "string" }, "timestamp": { "type": "integer", "format": "int64" }, "duration": { "type": "integer", "format": "int64" }, "isoTimestamp": { "type": "string", "nullable": true }, "isoDuration": { "type": "string", "nullable": true }, "deleted": { "type": "integer", "format": "int64" }, "order": { "type": "integer", "format": "int64" }, "confirmed": { "type": "integer", "format": "int64" }, "locked": { "type": "boolean" }, "hash": { "type": "string" }, "isOwner": { "type": "boolean" }, "votes": { "$ref": "#/components/schemas/OptionVotes" }, "owner": { "nullable": true, "allOf": [ { "$ref": "#/components/schemas/User" } ] } } }, "OptionVotes": { "type": "object", "required": [ "no", "yes", "maybe", "count", "currentUser" ], "properties": { "no": { "type": "integer", "format": "int64" }, "yes": { "type": "integer", "format": "int64" }, "maybe": { "type": "integer", "format": "int64" }, "count": { "type": "integer", "format": "int64" }, "currentUser": { "type": "string", "nullable": true } } }, "Poll": { "type": "object", "required": [ "id", "type", "votingVariant", "descriptionSafe", "configuration", "owner", "status", "currentUserStatus", "permissions", "pollGroups" ], "properties": { "id": { "type": "integer", "format": "int64" }, "type": { "type": "string" }, "votingVariant": { "type": "string" }, "descriptionSafe": { "type": "string" }, "configuration": { "$ref": "#/components/schemas/PollConfiguration" }, "owner": { "$ref": "#/components/schemas/User" }, "status": { "$ref": "#/components/schemas/PollsStatus" }, "currentUserStatus": { "$ref": "#/components/schemas/CurrentUserStatus" }, "permissions": { "$ref": "#/components/schemas/PollPermissions" }, "pollGroups": { "type": "array", "items": { "type": "integer", "format": "int64" } } } }, "PollConfiguration": { "type": "object", "required": [ "title", "description", "access", "allowComment", "allowDownload", "allowMaybe", "allowProposals", "anonymous", "autoReminder", "collapseDescription", "expire", "forceConfidentialComments", "forcedDisplayMode", "hideBookedUp", "proposalsExpire", "showResults", "timezoneName", "useNo", "maxVotesPerOption", "maxVotesPerUser" ], "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "access": { "type": "string" }, "allowComment": { "type": "boolean" }, "allowDownload": { "type": "boolean" }, "allowMaybe": { "type": "boolean" }, "allowProposals": { "type": "string" }, "anonymous": { "type": "boolean" }, "autoReminder": { "type": "boolean" }, "collapseDescription": { "type": "boolean" }, "expire": { "type": "integer", "format": "int64" }, "forceConfidentialComments": { "type": "boolean" }, "forcedDisplayMode": { "type": "string" }, "hideBookedUp": { "type": "boolean" }, "proposalsExpire": { "type": "integer", "format": "int64" }, "showResults": { "type": "string" }, "timezoneName": { "type": "string", "nullable": true }, "useNo": { "type": "boolean" }, "maxVotesPerOption": { "type": "integer", "format": "int64" }, "maxVotesPerUser": { "type": "integer", "format": "int64" } } }, "PollPermissions": { "type": "object", "required": [ "addOptions", "addShares", "addSharesExternal", "archive", "changeForeignVotes", "changeOwner", "clone", "comment", "confirmOptions", "deanonymize", "delete", "download", "edit", "reorderOptions", "seeResults", "seeUsernames", "subscribe", "takeOver", "view", "vote" ], "properties": { "addOptions": { "type": "boolean" }, "addShares": { "type": "boolean" }, "addSharesExternal": { "type": "boolean" }, "archive": { "type": "boolean" }, "changeForeignVotes": { "type": "boolean" }, "changeOwner": { "type": "boolean" }, "clone": { "type": "boolean" }, "comment": { "type": "boolean" }, "confirmOptions": { "type": "boolean" }, "deanonymize": { "type": "boolean" }, "delete": { "type": "boolean" }, "download": { "type": "boolean" }, "edit": { "type": "boolean" }, "reorderOptions": { "type": "boolean" }, "seeResults": { "type": "boolean" }, "seeUsernames": { "type": "boolean" }, "subscribe": { "type": "boolean" }, "takeOver": { "type": "boolean" }, "view": { "type": "boolean" }, "vote": { "type": "boolean" } } }, "PollsStatus": { "type": "object", "required": [ "lastInteraction", "created", "isAnonymous", "isArchived", "isExpired", "isRealAnonymous", "relevantThreshold", "deletionDate", "archivedDate", "countParticipants", "maxVotes", "maxOptionVotes", "forcedViewMode" ], "properties": { "lastInteraction": { "type": "integer", "format": "int64" }, "created": { "type": "integer", "format": "int64" }, "isAnonymous": { "type": "boolean" }, "isArchived": { "type": "boolean" }, "isExpired": { "type": "boolean" }, "isRealAnonymous": { "type": "boolean" }, "relevantThreshold": { "type": "integer", "format": "int64" }, "deletionDate": { "type": "integer", "format": "int64" }, "archivedDate": { "type": "integer", "format": "int64" }, "countParticipants": { "type": "integer", "format": "int64" }, "maxVotes": { "type": "integer", "format": "int64" }, "maxOptionVotes": { "type": "integer", "format": "int64" }, "forcedViewMode": { "type": "string", "nullable": true } } }, "SentMailInfo": { "type": "object", "required": [ "emailAddress", "displayName" ], "properties": { "emailAddress": { "type": "string" }, "displayName": { "type": "string" } } }, "SentResult": { "type": "object", "required": [ "sentMails", "abortedMails", "countSentMails", "countAbortedMails" ], "properties": { "sentMails": { "type": "array", "items": { "$ref": "#/components/schemas/SentMailInfo" } }, "abortedMails": { "type": "array", "items": { "$ref": "#/components/schemas/AbortedMailInfo" } }, "countSentMails": { "type": "integer", "format": "int64" }, "countAbortedMails": { "type": "integer", "format": "int64" } } }, "Sequence": { "type": "object", "required": [ "repetitions", "stepWidth", "unit" ], "properties": { "repetitions": { "type": "integer", "format": "int64" }, "stepWidth": { "type": "integer", "format": "int64" }, "unit": { "$ref": "#/components/schemas/SequenceUnit" } } }, "SequenceUnit": { "type": "object", "required": [ "id", "name", "timeOption" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "timeOption": { "type": "boolean" } } }, "Session": { "type": "object", "required": [ "token", "currentUser", "appPermissions", "appSettings" ], "properties": { "token": { "type": "string", "nullable": true }, "currentUser": { "$ref": "#/components/schemas/User" }, "appPermissions": { "$ref": "#/components/schemas/AppPermissions" }, "appSettings": { "$ref": "#/components/schemas/AppSettings" } } }, "Share": { "type": "object", "required": [ "id", "token", "type", "pollId", "groupId", "invitationSent", "reminderSent", "locked", "label", "URL", "publicPollEmail", "voted", "deleted", "user" ], "properties": { "id": { "type": "integer", "format": "int64" }, "token": { "type": "string" }, "type": { "type": "string" }, "pollId": { "type": "integer", "format": "int64", "nullable": true }, "groupId": { "type": "integer", "format": "int64", "nullable": true }, "invitationSent": { "type": "boolean" }, "reminderSent": { "type": "boolean" }, "locked": { "type": "boolean" }, "label": { "type": "string" }, "URL": { "type": "string" }, "publicPollEmail": { "type": "string" }, "voted": { "type": "boolean" }, "deleted": { "type": "boolean" }, "user": { "$ref": "#/components/schemas/User" } } }, "SimpleOption": { "type": "object", "properties": { "text": { "type": "string" }, "timestamp": { "type": "integer", "format": "int64" }, "isoDuration": { "type": "string" }, "duration": { "type": "integer", "format": "int64" }, "isoTimestamp": { "type": "string" } } }, "User": { "type": "object", "required": [ "array", "categories", "desc", "displayName", "emailAddress", "id", "user", "isAdmin", "isGuest", "isNoUser", "isUnrestrictedOwner", "languageCode", "localeCode", "organisation", "subname", "subtitle", "timeZone", "type", "userId" ], "properties": { "array": { "type": "string" }, "categories": { "type": "array", "items": { "type": "string" } }, "desc": { "type": "string" }, "displayName": { "type": "string" }, "emailAddress": { "type": "string" }, "id": { "type": "string" }, "user": { "type": "string", "nullable": true }, "isAdmin": { "type": "boolean" }, "isGuest": { "type": "boolean" }, "isNoUser": { "type": "boolean" }, "isUnrestrictedOwner": { "type": "boolean" }, "languageCode": { "type": "string" }, "languageCodeIntl": { "type": "string" }, "localeCode": { "type": "string" }, "localeCodeIntl": { "type": "string" }, "organisation": { "type": "string" }, "subname": { "type": "string" }, "subtitle": { "type": "string" }, "timeZone": { "type": "string" }, "type": { "type": "string" }, "userId": { "type": "string" } } }, "Vote": { "type": "object", "required": [ "id", "pollId", "optionText", "answer", "deleted", "optionId", "user", "answerSymbol" ], "properties": { "id": { "type": "integer", "format": "int64" }, "pollId": { "type": "integer", "format": "int64" }, "optionText": { "type": "string" }, "answer": { "type": "string" }, "deleted": { "type": "integer", "format": "int64" }, "optionId": { "type": "integer", "format": "int64", "nullable": true }, "user": { "$ref": "#/components/schemas/User" }, "answerSymbol": { "type": "string" } } }, "Watch": { "type": "object", "required": [ "id", "pollId", "table", "updated" ], "properties": { "id": { "type": "integer", "format": "int64" }, "pollId": { "type": "integer", "format": "int64" }, "table": { "type": "string" }, "updated": { "type": "integer", "format": "int64" } } } } }, "paths": { "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/comments": { "get": { "operationId": "comment_api-list", "summary": "Get all comments of a poll", "description": "This endpoint allows CORS requests", "tags": [ "comment_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Returns list of comments", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "comments" ], "properties": { "comments": { "type": "array", "items": { "$ref": "#/components/schemas/Comment" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/comment": { "post": { "operationId": "comment_api-add", "summary": "Add comment", "description": "This endpoint allows CORS requests", "tags": [ "comment_api" ], "security": [ { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "comment" ], "properties": { "comment": { "type": "string", "description": "Comment text to add" }, "confidential": { "type": "boolean", "default": false, "description": "Whether the comment is only visible to the poll owner and the author" } } } } } }, "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Comment added", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "comment" ], "properties": { "comment": { "$ref": "#/components/schemas/Comment" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/comment/{commentId}": { "delete": { "operationId": "comment_api-delete", "summary": "Delete comment", "description": "This endpoint allows CORS requests", "tags": [ "comment_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "commentId", "in": "path", "description": "Id of comment to delete", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Comment deleted", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "comment" ], "properties": { "comment": { "$ref": "#/components/schemas/Comment" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/comment/{commentId}/restore": { "post": { "operationId": "comment_api-restore", "summary": "Restore comment", "description": "This endpoint allows CORS requests", "tags": [ "comment_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "commentId", "in": "path", "description": "Id of comment to restore", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Comment restored", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "comment" ], "properties": { "comment": { "$ref": "#/components/schemas/Comment" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/options": { "get": { "operationId": "option_api-list", "summary": "Get all options of a poll", "description": "This endpoint allows CORS requests", "tags": [ "option_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Returns list of options", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "options" ], "properties": { "options": { "type": "array", "items": { "$ref": "#/components/schemas/Option" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "post": { "operationId": "option_api-add-bulk", "summary": "Add multiple new options from text", "description": "This endpoint allows CORS requests", "tags": [ "option_api" ], "security": [ { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "text": { "type": "string", "default": "", "description": "Options text (newline-separated) for text poll" } } } } } }, "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "201": { "description": "Options added", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "options" ], "properties": { "options": { "type": "array", "items": { "$ref": "#/components/schemas/Option" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/option": { "post": { "operationId": "option_api-add", "summary": "Add a new option", "description": "This endpoint allows CORS requests", "tags": [ "option_api" ], "security": [ { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "option" ], "properties": { "option": { "$ref": "#/components/schemas/SimpleOption", "description": "The array containing the option data" }, "voteYes": { "type": "boolean", "default": false, "description": "Vote yes for this option and for all generated sequence" }, "sequence": { "nullable": true, "default": null, "description": "Sequence of the option", "allOf": [ { "$ref": "#/components/schemas/Sequence" } ] } } } } } }, "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "201": { "description": "Option added", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "option", "repetitions", "options", "votes" ], "properties": { "option": { "$ref": "#/components/schemas/Option" }, "repetitions": { "type": "array", "items": { "$ref": "#/components/schemas/Option" } }, "options": { "type": "array", "items": { "$ref": "#/components/schemas/Option" } }, "votes": { "type": "array", "items": { "$ref": "#/components/schemas/Vote" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/option/{optionId}": { "put": { "operationId": "option_api-update", "summary": "Update option", "description": "This endpoint allows CORS requests", "tags": [ "option_api" ], "security": [ { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "timestamp": { "type": "integer", "format": "int64", "default": 0, "description": "Unix timestamp for date poll" }, "text": { "type": "string", "default": "", "description": "Option text for text poll" }, "duration": { "type": "integer", "format": "int64", "default": 0, "description": "Duration of option in seconds" }, "isoTimestamo": { "type": "string", "nullable": true, "default": null, "description": "ISO 8601 timestamp" }, "isoDuration": { "type": "string", "nullable": true, "default": null, "description": "ISO 8601 duration" } } } } } }, "parameters": [ { "name": "optionId", "in": "path", "description": "Option id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Option updated", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "option" ], "properties": { "option": { "$ref": "#/components/schemas/Option" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "delete": { "operationId": "option_api-delete", "summary": "Delete option", "description": "This endpoint allows CORS requests", "tags": [ "option_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "optionId", "in": "path", "description": "Option id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Option deleted", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "option" ], "properties": { "option": { "$ref": "#/components/schemas/Option" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/option/{optionId}/restore": { "put": { "operationId": "option_api-restore", "summary": "Restore option", "description": "This endpoint allows CORS requests", "tags": [ "option_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "optionId", "in": "path", "description": "Option id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Option restored", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "option" ], "properties": { "option": { "$ref": "#/components/schemas/Option" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/option/{optionId}/confirm": { "put": { "operationId": "option_api-confirm", "summary": "Switch option confirmation", "description": "This endpoint allows CORS requests", "tags": [ "option_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "optionId", "in": "path", "description": "Option id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Option confirmation toggled", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "option" ], "properties": { "option": { "$ref": "#/components/schemas/Option" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/option/{optionId}/order/{order}": { "put": { "operationId": "option_api-set-order", "summary": "Set order position for option", "description": "This endpoint allows CORS requests", "tags": [ "option_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "optionId", "in": "path", "description": "Option id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "order", "in": "path", "description": "Option's new position", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Option order updated", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "options" ], "properties": { "options": { "type": "array", "items": { "$ref": "#/components/schemas/Option" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/polls": { "get": { "operationId": "poll_api-list-polls", "summary": "Get list of polls", "description": "This endpoint allows CORS requests", "tags": [ "poll_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "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": "Returns list of polls", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "polls" ], "properties": { "polls": { "type": "array", "items": { "$ref": "#/components/schemas/Poll" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}": { "get": { "operationId": "poll_api-get", "summary": "Get complete poll with all related data", "description": "This endpoint allows CORS requests", "tags": [ "poll_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Returns complete poll data", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "poll", "options", "votes", "comments", "shares", "subscribed" ], "properties": { "poll": { "$ref": "#/components/schemas/Poll" }, "options": { "type": "array", "items": { "$ref": "#/components/schemas/Option" } }, "votes": { "type": "array", "items": { "$ref": "#/components/schemas/Vote" } }, "comments": { "type": "array", "items": { "$ref": "#/components/schemas/Comment" } }, "shares": { "type": "array", "items": { "$ref": "#/components/schemas/Share" } }, "subscribed": { "type": "boolean" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "put": { "operationId": "poll_api-update", "summary": "Update poll configuration", "description": "This endpoint allows CORS requests", "tags": [ "poll_api" ], "security": [ { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "pollConfiguration" ], "properties": { "pollConfiguration": { "type": "object", "description": "Poll configuration", "additionalProperties": { "type": "object" } } } } } } }, "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Poll updated", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "poll", "diff", "changes" ], "properties": { "poll": { "$ref": "#/components/schemas/Poll" }, "diff": { "type": "object", "additionalProperties": { "type": "object" } }, "changes": { "type": "object", "additionalProperties": { "type": "object" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "delete": { "operationId": "poll_api-delete", "summary": "Delete poll", "description": "This endpoint allows CORS requests", "tags": [ "poll_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Poll deleted", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "poll" ], "properties": { "poll": { "$ref": "#/components/schemas/Poll" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll": { "post": { "operationId": "poll_api-add", "summary": "Add poll", "description": "This endpoint allows CORS requests", "tags": [ "poll_api" ], "security": [ { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "type", "title" ], "properties": { "type": { "type": "string", "description": "Poll type ('datePoll', 'textPoll')" }, "title": { "type": "string", "description": "Poll title" }, "votingVariant": { "type": "string", "description": "Voting variant" } } } } } }, "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "201": { "description": "Poll created", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "poll" ], "properties": { "poll": { "$ref": "#/components/schemas/Poll" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/archive/toggle": { "put": { "operationId": "poll_api-toggle-archive", "summary": "Toggle archived status of a poll", "description": "This endpoint allows CORS requests", "tags": [ "poll_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Archive status toggled", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "poll" ], "properties": { "poll": { "$ref": "#/components/schemas/Poll" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/close": { "put": { "operationId": "poll_api-close", "summary": "Close poll", "description": "This endpoint allows CORS requests", "tags": [ "poll_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Poll closed", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "poll" ], "properties": { "poll": { "$ref": "#/components/schemas/Poll" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/reopen": { "put": { "operationId": "poll_api-reopen", "summary": "Reopen poll", "description": "This endpoint allows CORS requests", "tags": [ "poll_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Poll reopened", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "poll" ], "properties": { "poll": { "$ref": "#/components/schemas/Poll" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/clone": { "post": { "operationId": "poll_api-clone", "summary": "Clone poll", "description": "This endpoint allows CORS requests", "tags": [ "poll_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "201": { "description": "Poll cloned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "poll" ], "properties": { "poll": { "$ref": "#/components/schemas/Poll" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/addresses": { "get": { "operationId": "poll_api-get-participants-email-addresses", "summary": "Collect email addresses from participants", "description": "This endpoint allows CORS requests", "tags": [ "poll_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Returns participant email addresses", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "addresses" ], "properties": { "addresses": { "type": "array", "items": { "type": "object", "required": [ "displayName", "emailAddress", "combined" ], "properties": { "displayName": { "type": "string" }, "emailAddress": { "type": "string" }, "combined": { "type": "string" } } } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/shares": { "get": { "operationId": "share_api-list", "summary": "List shares of a poll", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Returns list of shares", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "shares" ], "properties": { "shares": { "type": "array", "items": { "$ref": "#/components/schemas/Share" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/share/{token}": { "get": { "operationId": "share_api-get", "summary": "Get share by token", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ {}, { "basic_auth": [] } ], "parameters": [ { "name": "token", "in": "path", "description": "Share token", "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": "Returns share", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "share" ], "properties": { "share": { "$ref": "#/components/schemas/Share" } } } } } } } } } } } }, "delete": { "operationId": "share_api-delete", "summary": "Delete share", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "token", "in": "path", "description": "Share token", "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": "Share deleted", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "share" ], "properties": { "share": { "$ref": "#/components/schemas/Share" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/s/{token}/register": { "post": { "operationId": "share_api-register", "summary": "Register as guest for a public poll", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ {}, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "displayName" ], "properties": { "displayName": { "type": "string", "description": "Guest display name" }, "emailAddress": { "type": "string", "default": "", "description": "Guest email address" }, "timeZone": { "type": "string", "default": "", "description": "Guest time zone" } } } } } }, "parameters": [ { "name": "token", "in": "path", "description": "Share token", "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": { "201": { "description": "Guest registered", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "share" ], "properties": { "share": { "$ref": "#/components/schemas/Share" } } } } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/s/{token}/email/{emailAddress}": { "put": { "operationId": "share_api-set-email-address", "summary": "Set email address for a share", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ {}, { "basic_auth": [] } ], "parameters": [ { "name": "token", "in": "path", "description": "Share token", "required": true, "schema": { "type": "string" } }, { "name": "emailAddress", "in": "path", "description": "New email address", "required": true, "schema": { "type": "string", "default": "" } }, { "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": "Email address updated", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "share" ], "properties": { "share": { "$ref": "#/components/schemas/Share" } } } } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/s/{token}/email": { "delete": { "operationId": "share_api-delete-email-address", "summary": "Delete email address from share", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ {}, { "basic_auth": [] } ], "parameters": [ { "name": "token", "in": "path", "description": "Share token", "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": "Email address removed", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "share" ], "properties": { "share": { "$ref": "#/components/schemas/Share" } } } } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/share/{type}": { "post": { "operationId": "share_api-add", "summary": "Add share to a poll", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "userId": { "type": "string", "default": "", "description": "User id" }, "displayName": { "type": "string", "default": "", "description": "Display name of user" }, "emailAddress": { "type": "string", "default": "", "description": "Email address of user" } } } } } }, "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "type", "in": "path", "description": "Share type", "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": { "201": { "description": "Share added", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "share" ], "properties": { "share": { "$ref": "#/components/schemas/Share" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/share/{token}/restore": { "put": { "operationId": "share_api-restore", "summary": "Restore deleted share", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "token", "in": "path", "description": "Share token", "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": "Share restored", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "share" ], "properties": { "share": { "$ref": "#/components/schemas/Share" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/share/{token}/lock": { "put": { "operationId": "share_api-lock", "summary": "Lock a share (read only)", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "token", "in": "path", "description": "Share token", "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": "Share locked", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "share" ], "properties": { "share": { "$ref": "#/components/schemas/Share" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/share/{token}/unlock": { "put": { "operationId": "share_api-unlock", "summary": "Unlock share", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "token", "in": "path", "description": "Share token", "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": "Share unlocked", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "share" ], "properties": { "share": { "$ref": "#/components/schemas/Share" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/share/{token}/invite": { "put": { "operationId": "share_api-send-invitation", "summary": "Send invitation mails for a share", "description": "This endpoint allows CORS requests", "tags": [ "share_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "token", "in": "path", "description": "Share token", "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": "Invitation sent", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "share", "sentResult" ], "properties": { "share": { "$ref": "#/components/schemas/Share" }, "sentResult": { "$ref": "#/components/schemas/SentResult" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/subscription": { "get": { "operationId": "subscription_api-get", "summary": "Get subscription status for a poll", "description": "This endpoint allows CORS requests", "tags": [ "subscription_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Returns subscription status", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "pollId", "subscribed" ], "properties": { "pollId": { "type": "integer", "format": "int64" }, "subscribed": { "type": "boolean" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "put": { "operationId": "subscription_api-subscribe", "summary": "Subscribe to poll", "description": "This endpoint allows CORS requests", "tags": [ "subscription_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Subscribed to poll", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "pollId", "subscribed" ], "properties": { "pollId": { "type": "integer", "format": "int64" }, "subscribed": { "type": "boolean" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "delete": { "operationId": "subscription_api-unsubscribe", "summary": "Unsubscribe from poll", "description": "This endpoint allows CORS requests", "tags": [ "subscription_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Unsubscribed from poll", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "pollId", "subscribed" ], "properties": { "pollId": { "type": "integer", "format": "int64" }, "subscribed": { "type": "boolean" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/preferences": { "post": { "operationId": "user_api-write-preferences", "summary": "Write user preferences", "description": "This endpoint allows CORS requests", "tags": [ "user_api" ], "security": [ { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "preferences" ], "properties": { "preferences": { "type": "object", "description": "Preferences to save", "additionalProperties": { "type": "object" } } } } } } }, "parameters": [ { "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": "Preferences saved", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "preferences" ], "properties": { "preferences": { "type": "object", "additionalProperties": { "type": "object" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/session": { "get": { "operationId": "user_api-get-session", "summary": "Get current user session info", "description": "This endpoint allows CORS requests", "tags": [ "user_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "token", "in": "query", "description": "Share token for public poll sessions", "schema": { "type": "string", "nullable": true, "default": null } }, { "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": "Returns session info", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "$ref": "#/components/schemas/Session" } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/votes": { "get": { "operationId": "vote_api-list", "summary": "Get all votes of a poll", "description": "This endpoint allows CORS requests", "tags": [ "vote_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "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": "Returns list of votes", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "votes" ], "properties": { "votes": { "type": "array", "items": { "$ref": "#/components/schemas/Vote" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/option/{optionId}/vote/{answer}": { "put": { "operationId": "vote_api-set", "summary": "Set vote answer", "description": "This endpoint allows CORS requests", "tags": [ "vote_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "optionId", "in": "path", "description": "Option id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "answer", "in": "path", "description": "Answer string ('yes', 'no', 'maybe')", "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": "Vote answer set", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "vote" ], "properties": { "vote": { "nullable": true, "allOf": [ { "$ref": "#/components/schemas/Vote" } ] } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/user/{userId}": { "delete": { "operationId": "vote_api-delete", "summary": "Remove user from poll", "description": "This endpoint allows CORS requests", "tags": [ "vote_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "userId", "in": "path", "description": "User to remove", "required": true, "schema": { "type": "string", "default": "" } }, { "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": "User removed from poll", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "deleted" ], "properties": { "deleted": { "type": "string" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/votes/orphaned": { "delete": { "operationId": "vote_api-delete-orphaned", "summary": "Delete orphaned votes of a user", "description": "This endpoint allows CORS requests", "tags": [ "vote_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "userId", "in": "query", "description": "User to delete orphan votes from", "schema": { "type": "string", "default": "" } }, { "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": "Orphaned votes deleted", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "deleted" ], "properties": { "deleted": { "type": "string" } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } }, "/ocs/v2.php/apps/polls/api/v1.0/poll/{pollId}/watch": { "get": { "operationId": "watch_api-watch-poll", "summary": "Watch poll for updates", "description": "This endpoint allows CORS requests", "tags": [ "watch_api" ], "security": [ { "basic_auth": [] } ], "parameters": [ { "name": "pollId", "in": "path", "description": "Poll id of poll to watch", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "name": "mode", "in": "query", "description": "The mode of watching, e.g. 'longPolling'", "required": true, "schema": { "type": "string" } }, { "name": "offset", "in": "query", "description": "Only watch changes after this timestamp", "schema": { "type": "integer", "format": "int64", "nullable": true } }, { "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": "Returns poll updates", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "updates" ], "properties": { "updates": { "type": "array", "items": { "$ref": "#/components/schemas/Watch" } } } } } } } } } } }, "401": { "description": "Current user is not logged in", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } } }, "tags": [ { "name": "public", "description": "Always use parent's class response* methods to make sure, the token gets set correctly. Requesting the token inside the controller is not possible, because the token is submitted as a paramter and not known while contruction time" } ] }