1# Dokuwiki (Rest) Api Plugin
2
3[![Build Status](https://travis-ci.org/gerardnico/dokuwiki-plugin-api.svg?branch=master)](https://travis-ci.org/gerardnico/dokuwiki-plugin-api)
4
5## About
6
7This is a Dokuwiki plugin that implements a rest API for Dokuwiki in order to use DokuWiki as a backend Content Management System (CMS).
8
9
10## Permissions
11All requests are made with the `public` permissions (ie [@ALL group](https://www.dokuwiki.org/acl))
12
13## Endpoints
14
15### pages
16`pages` returns a list of all pages
17
18```
19http://localhost:81/lib/exe/ajax.php?call=api&fn=pages&limit=10
20```
21Request Query parameters:
22  * `limit` : the max number of pages (known also under [pagename](https://www.dokuwiki.org/pagename))
23
24
25### page
26
27`page` returns much more information on a page than [pages](#pages)
28
29```
30http://localhost:81/lib/exe/ajax.php?call=api&fn=page
31```
32
33Query parameters:
34  * `id` : the page id (known also under [pagename](https://www.dokuwiki.org/pagename))
35
36## Configuration
37
38The following configuration have an impact on the export.
39As they are defined as constant inside DokuWiki, you can't update them on the fly.
40You need to change them in your configuration.
41
42### Relative URL
43
44If you want relative URL in the exported HTML. See https://www.dokuwiki.org/config:canonical
45
46### Base Directory
47
48See https://www.dokuwiki.org/config:basedir The DOKU_BASE constant.
49
50Used in the `wl` function of the `common.php` file to create a link.
51
52
53## Changes
54
55### 2023-06-09
56
57* `RemoteApi` dokuwiki class was renamed to `API`
58* Php8 ready
59* The Xml Call does not take `pagename` as array key
60