Skip to content

Instantly share code, notes, and snippets.

@splitbrain
Created January 7, 2024 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save splitbrain/d957e123a60999875b716285af64214c to your computer and use it in GitHub Desktop.
Save splitbrain/d957e123a60999875b716285af64214c to your computer and use it in GitHub Desktop.
openapi example DokuWiki
{
"openapi": "3.1.0",
"info": {
"title": "DokuWiki API",
"description": "The DokuWiki API OpenAPI specification",
"version": "12",
"x-locale": "en-US"
},
"servers": [
{
"url": "http:\/\/localhost\/devel\/dokuwiki\/lib\/exe\/jsonrpc.php"
}
],
"components": {
"securitySchemes": {
"basicAuth": {
"type": "http",
"scheme": "basic"
},
"jwt": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
},
"security": [
{
"basicAuth": []
},
{
"jwt": []
}
],
"paths": {
"\/core.getAPIVersion": {
"post": {
"operationId": "core.getAPIVersion",
"summary": "Return the API version",
"description": "This method is public and does not require authentication. \n\nThis is the version of the DokuWiki API. It increases whenever the API definition changes.\n\nWhen developing a client, you should check this version and make sure you can handle it.",
"tags": [
"Info"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "null"
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "",
"examples": [
42
],
"type": "integer"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
},
"security": [
{}
]
}
},
"\/core.getWikiVersion": {
"post": {
"operationId": "core.getWikiVersion",
"summary": "Return DokuWiki's version",
"description": "This returns the version in the form \"Type Date (SHA)\". Where type is either\n\"Release\" or \"Git\" and date is the date of the release or the date of the\nlast commit. SHA is the short SHA of the last commit - this is only added on\ngit checkouts.\n\nIf no version can be determined \"snapshot? update version XX\" is returned.\nWhere XX represents the update version number set in doku.php.",
"tags": [
"Info"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "null"
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "The version string e.g. \"Release 2023-04-04a\"",
"examples": [
"some-result"
],
"type": "string"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getWikiTitle": {
"post": {
"operationId": "core.getWikiTitle",
"summary": "Returns the wiki title",
"description": "This method is public and does not require authentication. \n\n\n\n**See also:**\n\n* [Config Title](https:\/\/www.dokuwiki.org\/config:title)",
"tags": [
"Info"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "null"
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "",
"examples": [
"some-result"
],
"type": "string"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
},
"security": [
{}
]
}
},
"\/core.getWikiTime": {
"post": {
"operationId": "core.getWikiTime",
"summary": "Return the current server time",
"description": "Returns a Unix timestamp (seconds since 1970-01-01 00:00:00 UTC).\n\nYou can use this to compensate for differences between your client's time and the\nserver's time when working with last modified timestamps (revisions).",
"tags": [
"Info"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "null"
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "A unix timestamp",
"examples": [
42
],
"type": "integer"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.login": {
"post": {
"operationId": "core.login",
"summary": "Login",
"description": "This method is public and does not require authentication. \n\nThis will use the given credentials and attempt to login the user. This will set the\nappropriate cookies, which can be used for subsequent requests.\n\nUse of this mechanism is discouraged. Using token authentication is preferred.",
"tags": [
"User"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"user",
"pass"
],
"properties": {
"user": {
"description": "The user name",
"examples": [
"some-user"
],
"type": "string"
},
"pass": {
"description": "The password",
"examples": [
"some-pass"
],
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "If the login was successful",
"examples": [
42
],
"type": "integer"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
},
"security": [
{}
]
}
},
"\/core.logoff": {
"post": {
"operationId": "core.logoff",
"summary": "Log off",
"description": "Attempt to log out the current user, deleting the appropriate cookies\n\nUse of this mechanism is discouraged. Using token authentication is preferred.",
"tags": [
"User"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "null"
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "0 on failure, 1 on success",
"examples": [
42
],
"type": "integer"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.whoAmI": {
"post": {
"operationId": "core.whoAmI",
"summary": "Info about the currently authenticated user",
"description": "",
"tags": [
"User"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "null"
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "",
"examples": [
{}
],
"type": "object",
"properties": {
"login": {
"description": "The login name of the user",
"type": "string"
},
"name": {
"description": "The full name of the user",
"type": "string"
},
"mail": {
"description": "The email address of the user",
"type": "string"
},
"groups": {
"description": "The groups the user is in",
"type": "array"
},
"isadmin": {
"description": "Whether the user is a super user",
"type": "boolean"
},
"ismanager": {
"description": "Whether the user is a manager",
"type": "boolean"
}
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.aclCheck": {
"post": {
"operationId": "core.aclCheck",
"summary": "Check ACL Permissions",
"description": "This call allows to check the permissions for a given page\/media and user\/group combination.\nIf no user\/group is given, the current user is used.\n\nRead the link below to learn more about the permission levels.\n\n**See also:**\n\n* [Acl Background Info](https:\/\/www.dokuwiki.org\/acl#background_info)",
"tags": [
"User"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"page"
],
"properties": {
"page": {
"description": "A page or media ID",
"examples": [
"playground:playground"
],
"type": "string"
},
"user": {
"description": "username [_default: `\"\"`_]",
"examples": [
"some-user"
],
"type": "string"
},
"groups": {
"description": "array of groups [_default: `[]`_]",
"examples": [
[
"some-groups",
"other-groups"
]
],
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "permission level",
"examples": [
42
],
"type": "integer"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.listPages": {
"post": {
"operationId": "core.listPages",
"summary": "List all pages in the given namespace (and below)",
"description": "Setting the `depth` to `0` and the `namespace` to `\"\"` will return all pages in the wiki.\n\nNote: author information is not available in this call.",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [],
"properties": {
"namespace": {
"description": "The namespace to search. Empty string for root namespace [_default: `\"\"`_]",
"examples": [
"some-namespace"
],
"type": "string"
},
"depth": {
"description": "How deep to search. 0 for all subnamespaces [_default: `1`_]",
"examples": [
42
],
"type": "integer"
},
"hash": {
"description": "Whether to include a MD5 hash of the page content [_default: `false`_]",
"examples": [
true
],
"type": "boolean"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "A list of matching pages",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "The page ID",
"type": "string"
},
"revision": {
"description": "The page revision aka last modified timestamp",
"type": "integer"
},
"size": {
"description": "The page size in bytes",
"type": "integer"
},
"title": {
"description": "The page title",
"type": "string"
},
"permission": {
"description": "The current user's permissions for this page",
"type": "integer"
},
"hash": {
"description": "MD5 sum over the page's content (if available and requested)",
"type": "string"
},
"author": {
"description": "The author of this page revision (if available and requested)",
"type": "string"
}
}
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.searchPages": {
"post": {
"operationId": "core.searchPages",
"summary": "Do a fulltext search",
"description": "This executes a full text search and returns the results. The query uses the standard\nDokuWiki search syntax.\n\nSnippets are provided for the first 15 results only. The title is either the first heading\nor the page id depending on the wiki's configuration.\n\n**See also:**\n\n* [Search Syntax](https:\/\/www.dokuwiki.org\/search#syntax)",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"query"
],
"properties": {
"query": {
"description": "The search query as supported by the DokuWiki search",
"examples": [
"some-query"
],
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "A list of matching pages",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array",
"items": {
"type": "object",
"properties": {
"score": {
"description": "The number of hits this result got",
"type": "integer"
},
"snippet": {
"description": "The HTML formatted snippet in which the search term was found (if available)",
"type": "string"
},
"hash": {
"description": "Not available for search results",
"type": "string"
},
"author": {
"description": "Not available for search results",
"type": "string"
},
"id": {
"description": "The page ID",
"type": "string"
},
"revision": {
"description": "The page revision aka last modified timestamp",
"type": "integer"
},
"size": {
"description": "The page size in bytes",
"type": "integer"
},
"title": {
"description": "The page title",
"type": "string"
},
"permission": {
"description": "The current user's permissions for this page",
"type": "integer"
}
}
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getRecentPageChanges": {
"post": {
"operationId": "core.getRecentPageChanges",
"summary": "Get recent page changes",
"description": "Returns a list of recent changes to wiki pages. The results can be limited to changes newer than\na given timestamp.\n\nOnly changes within the configured `$conf['recent']` range are returned. This is the default\nwhen no timestamp is given.\n\n**See also:**\n\n* [Config Recent](https:\/\/www.dokuwiki.org\/config:recent)",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [],
"properties": {
"timestamp": {
"description": "Only show changes newer than this unix timestamp [_default: `0`_]",
"examples": [
1704551507
],
"type": "integer"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "The page ID",
"type": "string"
},
"revision": {
"description": "The revision (timestamp) of this change",
"type": "integer"
},
"author": {
"description": "The author of this change",
"type": "string"
},
"ip": {
"description": "The IP address from where this change was made",
"type": "string"
},
"summary": {
"description": "The summary of this change",
"type": "string"
},
"type": {
"description": "The type of this change",
"type": "string"
},
"sizechange": {
"description": "The change in bytes",
"type": "integer"
}
}
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getPage": {
"post": {
"operationId": "core.getPage",
"summary": "Get a wiki page's syntax",
"description": "Returns the syntax of the given page. When no revision is given, the current revision is returned.\n\nA non-existing page (or revision) will return an empty string usually. For the current revision\na page template will be returned if configured.\n\nRead access is required for the page.",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"page"
],
"properties": {
"page": {
"description": "wiki page id",
"examples": [
"playground:playground"
],
"type": "string"
},
"rev": {
"description": "Revision timestamp to access an older revision [_default: `0`_]",
"examples": [
0
],
"type": "integer"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "the syntax of the page",
"examples": [
"some-result"
],
"type": "string"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getPageHTML": {
"post": {
"operationId": "core.getPageHTML",
"summary": "Return a wiki page rendered to HTML",
"description": "The page is rendered to HTML as it would be in the wiki. The HTML consist only of the data for the page\ncontent itself, no surrounding structural tags, header, footers, sidebars etc are returned.\n\nReferences in the HTML are relative to the wiki base URL unless the `canonical` configuration is set.\n\nIf the page does not exist, an error is returned.\n\n**See also:**\n\n* [Config Canonical](https:\/\/www.dokuwiki.org\/config:canonical)",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"page"
],
"properties": {
"page": {
"description": "page id",
"examples": [
"playground:playground"
],
"type": "string"
},
"rev": {
"description": "revision timestamp [_default: `0`_]",
"examples": [
0
],
"type": "integer"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "Rendered HTML for the page",
"examples": [
"some-result"
],
"type": "string"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getPageInfo": {
"post": {
"operationId": "core.getPageInfo",
"summary": "Return some basic data about a page",
"description": "The call will return an error if the requested page does not exist.\n\nRead access is required for the page.",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"page"
],
"properties": {
"page": {
"description": "page id",
"examples": [
"playground:playground"
],
"type": "string"
},
"rev": {
"description": "revision timestamp [_default: `0`_]",
"examples": [
0
],
"type": "integer"
},
"author": {
"description": "whether to include the author information [_default: `false`_]",
"examples": [
true
],
"type": "boolean"
},
"hash": {
"description": "whether to include the MD5 hash of the page content [_default: `false`_]",
"examples": [
true
],
"type": "boolean"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "",
"examples": [
{}
],
"type": "object",
"properties": {
"id": {
"description": "The page ID",
"type": "string"
},
"revision": {
"description": "The page revision aka last modified timestamp",
"type": "integer"
},
"size": {
"description": "The page size in bytes",
"type": "integer"
},
"title": {
"description": "The page title",
"type": "string"
},
"permission": {
"description": "The current user's permissions for this page",
"type": "integer"
},
"hash": {
"description": "MD5 sum over the page's content (if available and requested)",
"type": "string"
},
"author": {
"description": "The author of this page revision (if available and requested)",
"type": "string"
}
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getPageHistory": {
"post": {
"operationId": "core.getPageHistory",
"summary": "Returns a list of available revisions of a given wiki page",
"description": "The number of returned pages is set by `$conf['recent']`, but non accessible revisions pages\nare skipped, so less than that may be returned.\n\n**See also:**\n\n* [Config Recent](https:\/\/www.dokuwiki.org\/config:recent)",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"page"
],
"properties": {
"page": {
"description": "page id",
"examples": [
"playground:playground"
],
"type": "string"
},
"first": {
"description": "skip the first n changelog lines, 0 starts at the current revision [_default: `0`_]",
"examples": [
42
],
"type": "integer"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "The page ID",
"type": "string"
},
"revision": {
"description": "The revision (timestamp) of this change",
"type": "integer"
},
"author": {
"description": "The author of this change",
"type": "string"
},
"ip": {
"description": "The IP address from where this change was made",
"type": "string"
},
"summary": {
"description": "The summary of this change",
"type": "string"
},
"type": {
"description": "The type of this change",
"type": "string"
},
"sizechange": {
"description": "The change in bytes",
"type": "integer"
}
}
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getPageLinks": {
"post": {
"operationId": "core.getPageLinks",
"summary": "Get a page's links",
"description": "This returns a list of links found in the given page. This includes internal, external and interwiki links\n\nIf a link occurs multiple times on the page, it will be returned multiple times.\n\nRead access for the given page is needed and page has to exist.",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"page"
],
"properties": {
"page": {
"description": "page id",
"examples": [
"playground:playground"
],
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "A list of links found on the given page",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"description": "The type of this link: `internal`, `external` or `interwiki`",
"type": "string"
},
"page": {
"description": "The wiki page this link points to, same as `href` for external links",
"type": "string"
},
"href": {
"description": "A hyperlink pointing to the linked target",
"type": "string"
}
}
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getPageBackLinks": {
"post": {
"operationId": "core.getPageBackLinks",
"summary": "Get a page's backlinks",
"description": "A backlink is a wiki link on another page that links to the given page.\n\nOnly links from pages readable by the current user are returned. The page itself\nneeds to be readable. Otherwise an error is returned.",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"page"
],
"properties": {
"page": {
"description": "page id",
"examples": [
"playground:playground"
],
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "A list of pages linking to the given page",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array",
"items": {
"type": "string"
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.lockPages": {
"post": {
"operationId": "core.lockPages",
"summary": "Lock the given set of pages",
"description": "This call will try to lock all given pages. It will return a list of pages that were\nsuccessfully locked. If a page could not be locked, eg. because a different user is\ncurrently holding a lock, that page will be missing from the returned list.\n\nYou should always ensure that the list of returned pages matches the given list of\npages. It's up to you to decide how to handle failed locking.\n\nNote: you can only lock pages that you have write access for. It is possible to create\na lock for a page that does not exist, yet.\n\nNote: it is not necessary to lock a page before saving it. The `savePage()` call will\nautomatically lock and unlock the page for you. However if you plan to do related\noperations on multiple pages, locking them all at once beforehand can be useful.",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"pages"
],
"properties": {
"pages": {
"description": "A list of pages to lock",
"examples": [
[
"some-pages",
"other-pages"
]
],
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "A list of pages that were successfully locked",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array",
"items": {
"type": "string"
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.unlockPages": {
"post": {
"operationId": "core.unlockPages",
"summary": "Unlock the given set of pages",
"description": "This call will try to unlock all given pages. It will return a list of pages that were\nsuccessfully unlocked. If a page could not be unlocked, eg. because a different user is\ncurrently holding a lock, that page will be missing from the returned list.\n\nYou should always ensure that the list of returned pages matches the given list of\npages. It's up to you to decide how to handle failed unlocking.\n\nNote: you can only unlock pages that you have write access for.",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"pages"
],
"properties": {
"pages": {
"description": "A list of pages to unlock",
"examples": [
[
"some-pages",
"other-pages"
]
],
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "A list of pages that were successfully unlocked",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array",
"items": {
"type": "string"
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.savePage": {
"post": {
"operationId": "core.savePage",
"summary": "Save a wiki page",
"description": "Saves the given wiki text to the given page. If the page does not exist, it will be created.\nJust like in the wiki, saving an empty text will delete the page.\n\nYou need write permissions for the given page and the page may not be locked by another user.",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"page",
"text"
],
"properties": {
"page": {
"description": "page id",
"examples": [
"playground:playground"
],
"type": "string"
},
"text": {
"description": "wiki text",
"examples": [
"some-text"
],
"type": "string"
},
"summary": {
"description": "edit summary [_default: `\"\"`_]",
"examples": [
"some-summary"
],
"type": "string"
},
"isminor": {
"description": "whether this is a minor edit [_default: `false`_]",
"examples": [
true
],
"type": "boolean"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "Returns true on success",
"examples": [
true
],
"type": "boolean"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.appendPage": {
"post": {
"operationId": "core.appendPage",
"summary": "Appends text to the end of a wiki page",
"description": "If the page does not exist, it will be created. If a page template for the non-existant\npage is configured, the given text will appended to that template.\n\nThe call will create a new page revision.\n\nYou need write permissions for the given page.",
"tags": [
"Pages"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"page",
"text"
],
"properties": {
"page": {
"description": "page id",
"examples": [
"playground:playground"
],
"type": "string"
},
"text": {
"description": "wiki text",
"examples": [
"some-text"
],
"type": "string"
},
"summary": {
"description": "edit summary [_default: `\"\"`_]",
"examples": [
"some-summary"
],
"type": "string"
},
"isminor": {
"description": "whether this is a minor edit [_default: `false`_]",
"examples": [
true
],
"type": "boolean"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "Returns true on success",
"examples": [
true
],
"type": "boolean"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.listMedia": {
"post": {
"operationId": "core.listMedia",
"summary": "List all media files in the given namespace (and below)",
"description": "Setting the `depth` to `0` and the `namespace` to `\"\"` will return all media files in the wiki.\n\nWhen `pattern` is given, it needs to be a valid regular expression as understood by PHP's\n`preg_match()` including delimiters.\nThe pattern is matched against the full media ID, including the namespace.\n\n**See also:**\n\n* https:\/\/www.php.net\/manual\/en\/reference.pcre.pattern.syntax.php",
"tags": [
"Media"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [],
"properties": {
"namespace": {
"description": "The namespace to search. Empty string for root namespace [_default: `\"\"`_]",
"examples": [
"some-namespace"
],
"type": "string"
},
"pattern": {
"description": "A regular expression to filter the returned files [_default: `\"\"`_]",
"examples": [
"some-pattern"
],
"type": "string"
},
"depth": {
"description": "How deep to search. 0 for all subnamespaces [_default: `1`_]",
"examples": [
42
],
"type": "integer"
},
"hash": {
"description": "Whether to include a MD5 hash of the media content [_default: `false`_]",
"examples": [
true
],
"type": "boolean"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "The media ID",
"type": "string"
},
"revision": {
"description": "The media revision aka last modified timestamp",
"type": "integer"
},
"size": {
"description": "The page size in bytes",
"type": "integer"
},
"permission": {
"description": "The current user's permissions for this file",
"type": "integer"
},
"isimage": {
"description": "Wether this is an image file",
"type": "boolean"
},
"hash": {
"description": "MD5 sum over the file's content (if available and requested)",
"type": "string"
},
"author": {
"description": "The author of this page revision (if available and requested)",
"type": "string"
}
}
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getRecentMediaChanges": {
"post": {
"operationId": "core.getRecentMediaChanges",
"summary": "Get recent media changes",
"description": "Returns a list of recent changes to media files. The results can be limited to changes newer than\na given timestamp.\n\nOnly changes within the configured `$conf['recent']` range are returned. This is the default\nwhen no timestamp is given.\n\n**See also:**\n\n* [Config Recent](https:\/\/www.dokuwiki.org\/config:recent)",
"tags": [
"Media"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [],
"properties": {
"timestamp": {
"description": "Only show changes newer than this unix timestamp [_default: `0`_]",
"examples": [
1704551507
],
"type": "integer"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "The media ID",
"type": "string"
},
"revision": {
"description": "The revision (timestamp) of this change",
"type": "integer"
},
"author": {
"description": "The author of this change",
"type": "string"
},
"ip": {
"description": "The IP address from where this change was made",
"type": "string"
},
"summary": {
"description": "The summary of this change",
"type": "string"
},
"type": {
"description": "The type of this change",
"type": "string"
},
"sizechange": {
"description": "The change in bytes",
"type": "integer"
}
}
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getMedia": {
"post": {
"operationId": "core.getMedia",
"summary": "Get a media file's content",
"description": "Returns the content of the given media file. When no revision is given, the current revision is returned.\n\n**See also:**\n\n* https:\/\/en.wikipedia.org\/wiki\/Base64",
"tags": [
"Media"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"media"
],
"properties": {
"media": {
"description": "file id",
"examples": [
"wiki:dokuwiki-128.png"
],
"type": "string"
},
"rev": {
"description": "revision timestamp [_default: `0`_]",
"examples": [
0
],
"type": "integer"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "Base64 encoded media file contents",
"examples": [
"some-result"
],
"type": "string"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.getMediaInfo": {
"post": {
"operationId": "core.getMediaInfo",
"summary": "Return info about a media file",
"description": "The call will return an error if the requested media file does not exist.\n\nRead access is required for the media file.",
"tags": [
"Media"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"media"
],
"properties": {
"media": {
"description": "file id",
"examples": [
"wiki:dokuwiki-128.png"
],
"type": "string"
},
"rev": {
"description": "revision timestamp [_default: `0`_]",
"examples": [
0
],
"type": "integer"
},
"author": {
"description": "whether to include the author information [_default: `false`_]",
"examples": [
true
],
"type": "boolean"
},
"hash": {
"description": "whether to include the MD5 hash of the media content [_default: `false`_]",
"examples": [
true
],
"type": "boolean"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "",
"examples": [
{}
],
"type": "object",
"properties": {
"id": {
"description": "The media ID",
"type": "string"
},
"revision": {
"description": "The media revision aka last modified timestamp",
"type": "integer"
},
"size": {
"description": "The page size in bytes",
"type": "integer"
},
"permission": {
"description": "The current user's permissions for this file",
"type": "integer"
},
"isimage": {
"description": "Wether this is an image file",
"type": "boolean"
},
"hash": {
"description": "MD5 sum over the file's content (if available and requested)",
"type": "string"
},
"author": {
"description": "The author of this page revision (if available and requested)",
"type": "string"
}
}
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.saveMedia": {
"post": {
"operationId": "core.saveMedia",
"summary": "Uploads a file to the wiki",
"description": "The file data has to be passed as a base64 encoded string.\n\n**See also:**\n\n* https:\/\/en.wikipedia.org\/wiki\/Base64",
"tags": [
"Media"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"media",
"base64"
],
"properties": {
"media": {
"description": "media id",
"examples": [
"wiki:dokuwiki-128.png"
],
"type": "string"
},
"base64": {
"description": "Base64 encoded file contents",
"examples": [
"some-base64"
],
"type": "string"
},
"overwrite": {
"description": "Should an existing file be overwritten? [_default: `false`_]",
"examples": [
true
],
"type": "boolean"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "Should always be true",
"examples": [
true
],
"type": "boolean"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/core.deleteMedia": {
"post": {
"operationId": "core.deleteMedia",
"summary": "Deletes a file from the wiki",
"description": "You need to have delete permissions for the file.",
"tags": [
"Media"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"media"
],
"properties": {
"media": {
"description": "media id",
"examples": [
"wiki:dokuwiki-128.png"
],
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "Should always be true",
"examples": [
true
],
"type": "boolean"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/plugin.acl.listAcls": {
"post": {
"operationId": "plugin.acl.listAcls",
"summary": "Get the list all ACL config entries",
"description": "",
"tags": [
"Plugins"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "null"
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "{Scope: ACL}, where ACL = dictionnary {user\/group: permissions_int}",
"examples": [
[
"some-result",
"other-result"
]
],
"type": "array"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/plugin.acl.addAcl": {
"post": {
"operationId": "plugin.acl.addAcl",
"summary": "Add a new ACL rule to the config",
"description": "",
"tags": [
"Plugins"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"scope",
"user",
"level"
],
"properties": {
"scope": {
"description": "The page or namespace to apply the ACL to",
"examples": [
"some-scope"
],
"type": "string"
},
"user": {
"description": "The user or group to apply the ACL to",
"examples": [
"some-user"
],
"type": "string"
},
"level": {
"description": "The permission level to set",
"examples": [
42
],
"type": "integer"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "If adding the ACL rule was successful",
"examples": [
true
],
"type": "boolean"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/plugin.acl.delAcl": {
"post": {
"operationId": "plugin.acl.delAcl",
"summary": "Remove an entry from ACL config",
"description": "",
"tags": [
"Plugins"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"scope",
"user"
],
"properties": {
"scope": {
"description": "The page or namespace the ACL applied to",
"examples": [
"some-scope"
],
"type": "string"
},
"user": {
"description": "The user or group the ACL applied to",
"examples": [
"some-user"
],
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "If removing the ACL rule was successful",
"examples": [
true
],
"type": "boolean"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/plugin.usermanager.createUser": {
"post": {
"operationId": "plugin.usermanager.createUser",
"summary": "Create a new user",
"description": "If no password is provided, a password is auto generated. If the user can't be created\nby the auth backend a return value of `false` is returned. You need to check this return\nvalue rather than relying on the error code only.\n\nSuperuser permission are required to create users.",
"tags": [
"Plugins"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"user",
"name",
"mail",
"groups"
],
"properties": {
"user": {
"description": "The user's login name",
"examples": [
"some-user"
],
"type": "string"
},
"name": {
"description": "The user's full name",
"examples": [
"some-name"
],
"type": "string"
},
"mail": {
"description": "The user's email address",
"examples": [
"some-mail"
],
"type": "string"
},
"groups": {
"description": "The groups the user should be in",
"examples": [
[
"some-groups",
"other-groups"
]
],
"type": "array",
"items": {
"type": "string"
}
},
"password": {
"description": "The user's password, empty for autogeneration [_default: `\"\"`_]",
"examples": [
"some-password"
],
"type": "string"
},
"notify": {
"description": "Whether to send a notification email to the user [_default: `false`_]",
"examples": [
true
],
"type": "boolean"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "Wether the user was successfully created",
"examples": [
true
],
"type": "boolean"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
},
"\/plugin.usermanager.deleteUser": {
"post": {
"operationId": "plugin.usermanager.deleteUser",
"summary": "Remove a user",
"description": "You need to be a superuser to delete users.",
"tags": [
"Plugins"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"required": [
"user"
],
"properties": {
"user": {
"description": "The login name of the user to delete",
"examples": [
[
"some-user",
"other-user"
]
],
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result",
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"description": "wether the user was successfully deleted",
"examples": [
true
],
"type": "boolean"
},
"error": {
"type": "object",
"description": "Error object in case of an error",
"properties": {
"code": {
"type": "integer",
"description": "The error code",
"examples": [
0
]
},
"message": {
"type": "string",
"description": "The error message",
"examples": [
"Success"
]
}
}
}
}
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment