DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:xmlrpc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
devel:xmlrpc [2022-06-29 22:11] – [dokuwiki.setLocks] Klap-indevel:xmlrpc [2024-01-31 23:57] (current) – [Adding methods to the XML-RPC API] Klap-in
Line 1: Line 1:
 ====== XML-RPC ====== ====== XML-RPC ======
  
-DokuWiki has a [[wp>XML-RPC]] API which can be used to access/interact with your wiki from other applications. The API implements the [[http://www.ecyrd.com/JSPWiki/wiki/WikiRPCInterface2|Wiki RPC Interface 2.0 Specifications]] in the ''wiki.*'' namespace and adds additional DokuWiki specific calls in the ''dokuwiki.*'' namespace. See [[custom_webservices|web services]] for some general notes about DokuWikis possibilities.+XML-RPC is one of the available protocols to access DokuWiki's [[Remote API]]. 
 + 
 + 
 +The API implements the [[http://www.jspwiki.org/wiki/WikiRPCInterface2|Wiki RPC Interface 2.0 Specifications]] ([[https://web.archive.org/web/20130526043929/http://www.jspwiki.org/wiki/WikiRPCInterface2|web.archive.org]]) in the ''wiki.*'' namespace and adds additional DokuWiki specific calls in the ''dokuwiki.*'' namespace. 
  
 Plugins can add their own calls to the API using [[devel:remote_plugins|Remote Plugin components]]. Plugins can add their own calls to the API using [[devel:remote_plugins|Remote Plugin components]].
  
-Questions and suggestions to extend and improve the API should be directed to the [[:mailinglist]].+Note: there is also a [[jsonrpc|JSON-RPC]] API which provides the same functionality but is based on JSON rather XML. 
  
 ===== Get It Working ===== ===== Get It Working =====
  
-  - You need at least the 2008-03-31 release of DokuWiki. 
   - Set the [[config:remote]] option to enable XML-RPC in the Configuration Settings "Authentication" section   - Set the [[config:remote]] option to enable XML-RPC in the Configuration Settings "Authentication" section
   - Set the [[config:remoteuser]] option with a mix of comma separated "usernames,groups"    - Set the [[config:remoteuser]] option with a mix of comma separated "usernames,groups" 
Line 41: Line 44:
  
 <?xml version="1.0"?> <?xml version="1.0"?>
-  <methodCall>+<methodCall>
     <methodName>examples.getStateName</methodName>     <methodName>examples.getStateName</methodName>
     <params>     <params>
-      <param>  +        <param>  
-        <value> +            <value> 
-          <i4>41</i4> +                <i4>41</i4> 
-        </value> +            </value> 
-      </param> +        </param> 
     </params>      </params> 
-  </methodCall> +</methodCall> 
 </code> </code>
  
 <code xml> <code xml>
-  <?xml version="1.0"?> +<?xml version="1.0"?> 
-    <methodCall> +<methodCall> 
-      <methodName>dokuwiki.getVersion</methodName> +    <methodName>dokuwiki.getVersion</methodName> 
-    </methodCall>+</methodCall>
 </code> </code>
  
Line 63: Line 66:
  
 <code xml> <code xml>
-  <?xml version="1.0"?>+<?xml version="1.0"?>
 <methodCall> <methodCall>
- <methodName>wiki.putPage</methodName> +    <methodName>wiki.putPage</methodName> 
- <params> +    <params> 
- <param>  +        <param>  
- <value> +            <value> 
- <string>myputpage   +                <string>myputpage   
- </string> +                </string> 
- </value> +            </value> 
- </param>  +        </param>  
- <param>  +        <param>  
- <value> +            <value> 
- <string>This is my page content</string> +                <string>This is my page content</string> 
- </value> +            </value> 
- </param> +        </param> 
- <param>  +        <param>  
- <value> +            <value> 
- <struct> +                <struct> 
- <member> +                    <member> 
- <name>sum</name> +                        <name>sum</name> 
- <value><string>Spiceworks</string></value> +                        <value><string>Spiceworks</string></value> 
- </member> +                    </member> 
- <member> +                    <member> 
- <name>minor</name> +                        <name>minor</name> 
- <value><boolean>True</boolean></value> +                        <value><boolean>True</boolean></value> 
- </member> +                    </member> 
- </struct> +                </struct> 
- </value> +            </value> 
- </param>  +        </param>  
- </params> +    </params> 
 </methodCall> </methodCall>
 </code> </code>
Line 232: Line 235:
 ^ Name         | ''wiki.getPageVersions''                                                                                                                                                                                                                                                               | ^ Name         | ''wiki.getPageVersions''                                                                                                                                                                                                                                                               |
 ^ Parameters   | (string) [[:pagename]], (int) offset                                                                                                                                                                                                                                                   | ^ Parameters   | (string) [[:pagename]], (int) offset                                                                                                                                                                                                                                                   |
-^ Data         | (array) each array item holds the following data: \\ \\ <code>$data['user'] = username $data['ip'] = ip address $data['type'] = type of change $data['sum'] = summary $data['modified'] =  modification date as IXR_Date Object  $data['version'] = page version as timestamp </code>  |+^ Data         | (array) each array item holds the following data: \\ \\ <code>$data['user'] = username 
 +$data['ip'] = ip address 
 +$data['type'] = type of change 
 +$data['sum'] = summary 
 +$data['modified'] =  modification date as IXR_Date Object 
 +$data['version'] = page version as timestamp</code>  |
 ^ Description  | Returns the available versions of a Wiki page. The number of pages in the result is controlled via the [[:config:recent]] configuration setting. The offset can be used to list earlier versions in the history.  | ^ Description  | Returns the available versions of a Wiki page. The number of pages in the result is controlled via the [[:config:recent]] configuration setting. The offset can be used to list earlier versions in the history.  |
  
Line 350: Line 358:
 ==== wiki.putAttachment ==== ==== wiki.putAttachment ====
 ^ Name        | ''wiki.putAttachment'' | ^ Name        | ''wiki.putAttachment'' |
-^ Parameters  | (String) id, (base64) data, (array) params |+^ Parameters  | (String) id, (base64) data, (array) params\\ Available parameters are: <code>$params['ow'] = true if file is to overwrite an already 
 +existing media object of the given id.</code> |
 ^ Data        | | ^ Data        | |
-^ Description | Uploads a file as a given media id. Available parameters are: \\ \\ <code>$params['ow'] = true if file is to overwrite an already existing media object of the given id</code>. |+^ Description | Uploads a file as a given media id. |
  
 ==== wiki.deleteAttachment ==== ==== wiki.deleteAttachment ====
Line 386: Line 395:
 ---- pluginquery ----- ---- pluginquery -----
 SELECT: name, description SELECT: name, description
-WHERE:  (type > ? AND type < ?) and (compatible LIKE ? OR compatible LIKE ? OR compatible = ?) +WHERE:  (type > ? AND type < ?) and (bestcompatible LIKE ? OR bestcompatible LIKE ? OR compatible = ?) 
-VALUES: 63, 128, %Hogfather%%Greebo%, (bundled)+VALUES: 63, 128, @DATEMOSTRECENT@@DATESECONDMOSTRECENT@, (bundled) 
 +headline: Remote plugins compatible with last two releases
 ----- -----
  
devel/xmlrpc.1656533506.txt.gz · Last modified: 2022-06-29 22:11 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki