Changes for page REST API

Last modified by Thomas Mortagne on 2024/03/12

From version 38.2
edited by Fabio Mancinelli
on 2012/11/07
Change comment: There is no comment for this version
To version 40.2
edited by Vincent Massol
on 2012/11/12
Change comment: Fix some broken links

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.fmancinelli
1 +XWiki.VincentMassol
Content
... ... @@ -83,7 +83,7 @@
83 83  The XWiki RESTful API is accessible through HTTP so, in principle, you can use every client that is capable of "speaking" HTTP in order to interact with it. Even a web browser!
84 84  If you want to write more complex programs you might download an HTTP library for your favorite language (e.g., [[http://hc.apache.org/]]).
85 85  
86 -Java users might take advantage of the [[JAXB>>https://jaxb.dev.java.net]] framework and its [[XJC binding compiler>>https://jaxb.dev.java.net/jaxb20-ea3/docs/xjc.html]] in order to generate domain object models directly from the [[XML Schema Definition>>https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-model/src/main/resources/xwiki.rest.model.xsd]], and use them for serializing and de-serializing XML representations.
86 +Java users might take advantage of the [[JAXB>>http://jaxb.java.net/]] framework and its [[XJC binding compiler>>http://jaxb.java.net/2.2.4/docs/xjc.html]] in order to generate domain object models directly from the [[XML Schema Definition>>https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-model/src/main/resources/xwiki.rest.model.xsd]], and use them for serializing and de-serializing XML representations.
87 87  
88 88  If you use this approach (Apache HTTP Client + JAXB) you will find yourself writing some code like this:
89 89  
... ... @@ -276,12 +276,10 @@
276 276  ** **Query parameters**
277 277  *** backup={true/false} - import XAR as a backup XAR
278 278  *** history={RESET/REPLACE/ADD} - history importing
279 -** **Description:** information about the wiki
279 +** **Description:** import a XAR in a wiki.
280 280  ** **Status codes:**
281 281  *** 200: If the request was successful.
282 282  
283 -
284 -
285 285  === /wikis/{wikiName}/search?q~={keywords}~[~[&scope~={name,content,title,objects}...]&start~=n]~[&number~=n]~[&orderField~=field&order~={asc,desc}]~[distinct~={true,false}]~[&prettyNames~={true,false}] ===
286 286  
287 287  * **HTTP Method:** GET
... ... @@ -300,6 +300,20 @@
300 300  ** **Status codes:**
301 301  *** 200: If the request was successful.
302 302  
301 +=== /wikimanager (This resource is only available when using XWiki Enterprise Manager)
302 +
303 +* **HTTP Method:** POST
304 +** **Accepted Media types:**
305 +*** application/xml (Wiki element)
306 +** **Media types:**
307 +*** application/xml (Wiki element)
308 +** **Query parameters**
309 +*** template - the wiki template to be used for initializing the wiki.
310 +*** history={RESET/REPLACE/ADD} - history importing
311 +** **Description:** create a new wiki.
312 +** **Status codes:**
313 +*** 200: If the request was successful.
314 +
303 303  == Space resources ==
304 304  
305 305  === /wikis/{wikiName}/spaces[?start~=offset&number~=n] ===
... ... @@ -915,6 +915,16 @@
915 915  
916 916  You can find more examples on [[https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/resources]].
917 917  
930 +Starting from release 4.3M2, the RESTful API modules have been refactored so that now resource declarations are available in a separate module.
931 +This means that all the information about resources, i.e., URI Paths, supported methods, query parameters, and so on, are available to module developers without having to include the big REST Server module.
932 +
933 +Clients willing to access/use the REST API can then declare a dependency on xwiki-platform-rest-api and have all this information available for interacting with it. There are two use cases for this:
934 +* Another platform module that wants to generate responses with links to existing resources.
935 +* HTTP clients that wants to make requests to the RESTful API.
936 +
937 +The xwiki-platform-rest-api module can be also seen as an authoritative reference for the REST API.
938 +
939 +
918 918  = Using the RESTful API =
919 919  
920 920  == Highlevel description and tutorial for a basic usage of the RESTful API ==

Get Connected