Wiki source code of The XWiki RESTful API

Version 19.1 by Fabio Mancinelli on 2010/01/18

Hide last authors
Vincent Massol 14.2 1 {{box cssClass="floatinginfobox" title="**Contents**"}}{{toc depth="2"/}}{{/box}}
Fabio Mancinelli 1.1 2
Silvia Macovei 10.5 3 XWiki provides fine-grain access to virtually every element through an API that is based on HTTP semantics, i.e., a RESTful API. In this page you will find all the details to take advantage of this API and the instructions to use it at its full potential.
Fabio Mancinelli 1.1 4
Fabio Mancinelli 17.1 5 = Accessing the service=
Fabio Mancinelli 16.1 6
Fabio Mancinelli 17.1 7 By defaut the XWiki RESTful API entrypoint is rooted at the following URI:
8
9 {{code}}
10
11 http://host:port/xwiki/rest
12
13 {{/code}}
14
Vincent Massol 17.2 15 All the resource references described in the [[XWiki RESTful API Documentation>>#HXWikiRESTfulAPIDocumentation]] should be intended relative to this URL.
Fabio Mancinelli 17.1 16
17 For example the, the ##/wikis## resources on a server running on ##localhost## on port ##8080## can be retrieved using the following URL : ##http:~//localhost:8080/xwiki/rest/wikis##
18
Vincent Massol 14.2 19 = Dataset =
Fabio Mancinelli 1.1 20
21 This section contains a brief and high-level description of the XWiki data set that should serve as a basis for presenting resources and their associated operations.
22
Silvia Macovei 10.3 23 XWiki has **pages** organized in **spaces**. Each **page** is available in multiple **versions** (its **history**) and **translations**. Translated pages have their own **versions** and **history** which are independent. Each page might have **attachments**. Each attachment has its own **history**. Attachments are shared among all the different translations of a page (i.e., the same set of attachments is the same regardless of the page language). Pages can have one or more **objects**. Objects are instances of a **class** that contains a set of **properties**. Some objects might be directly exposed as first class entities, such as **comments** and **tags**. Objects, as attachments, are shared among all page translations.
Fabio Mancinelli 1.1 24
Vincent Massol 14.2 25 = Understanding resources and representations =
Fabio Mancinelli 1.1 26
Silvia Macovei 10.4 27 "An important concept in REST is the existence of resources (sources of specific information), each of which is referenced with a global identifier (e.g., an URI in HTTP). In order to manipulate these resources, components of the network (user agents and origin servers) communicate via a standardized interface (e.g., HTTP) and exchange representations of these resources (the actual documents conveying the information)." ([[Wikipedia>>http://en.wikipedia.org/wiki/Representational_State_Transfer#REST.27s_central_principle:_resources]])
Fabio Mancinelli 1.1 28
Silvia Macovei 9.1 29 Resources in XWiki are pages, attachments, objects, properties, spaces, and all the //things// we described in the previous section. XWiki has a default way of conveying the information about these resources, i.e., by providing well defined XML representations that contain all the information associated to the resource in an XML format. This format is described using an XML Schema Definition file that can be found here: [[http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-rest/src/main/resources/xwiki.rest.model.xsd]]
Fabio Mancinelli 1.1 30
Silvia Macovei 10.4 31 Of course the same resource can be represented in many different ways. This is yet to be documented.
Fabio Mancinelli 1.1 32
Silvia Macovei 10.4 33 Another important aspect of representations is that they contain useful information for linking related resources. This is a realization of the //Hypermedia As The Engine Of The Application State (HATEOAS)// principle. In XML representations this information is conveyed through the ##<link>## tag. This tag has two important parameters: **rel** and **href**. **rel** specifies the "semantics" of the link, while **href** is the URI of the linked resource.
Silvia Macovei 9.2 34
Fabio Mancinelli 1.1 35 For example, in the representation of a page, we can have links to the comments, tags, attachments which are independent resources associated to the current page. These links are provided in the XML representation of a page and allow a client to navigate to related resources... Like we do every day when we click on a link in a web page.
Silvia Macovei 9.2 36
Silvia Macovei 9.1 37 [[image:representation||height="430"]]
Fabio Mancinelli 1.1 38
Vincent Massol 14.2 39 == Relations ==
Fabio Mancinelli 1.1 40
Fabio Mancinelli 5.1 41 The available relations that you might find in the XML resource representations are the following:
Fabio Mancinelli 1.1 42
Silvia Macovei 9.1 43 |=Rel|=Semantics
Fabio Mancinelli 15.1 44 |{{{http://www.xwiki.org/rel/wikis}}}|The representation containing the list of virtual wikis.
45 |{{{http://www.xwiki.org/rel/spaces}}}|The representation containing the list of spaces in a wiki.
46 |{{{http://www.xwiki.org/rel/pages}}}|The representation containing the list of pages in a space.
47 |{{{http://www.xwiki.org/rel/translation}}}|The representation containing a translation of a page.
48 |{{{http://www.xwiki.org/rel/page}}}|The representation for a page.
49 |{{{http://www.xwiki.org/rel/space}}}|The representation for a space.
50 |{{{http://www.xwiki.org/rel/parent}}}|The representation for the page that is parent of the current resource.
51 |{{{http://www.xwiki.org/rel/home}}}|The representation for the page that is the home of the current resource.
52 |{{{http://www.xwiki.org/rel/attachmentData}}}|The representation of the actual attachment data.
53 |{{{http://www.xwiki.org/rel/comments}}}|The representation of the list of comments associated to the current resource.
54 |{{{http://www.xwiki.org/rel/attachments}}}|The representation of the list of attachments associated to the current resource.
55 |{{{http://www.xwiki.org/rel/objects}}}|The representation of the list of objects associated to the current resource.
56 |{{{http://www.xwiki.org/rel/object}}}|The representation for an object.
57 |{{{http://www.xwiki.org/rel/classes}}}|The representation of the list of classes associated to the current resource.
58 |{{{http://www.xwiki.org/rel/history}}}|The representation of the list of history information associated to the current resource.
59 |{{{http://www.xwiki.org/rel/class}}}|The representation for a class.
60 |{{{http://www.xwiki.org/rel/property}}}|The representation for a property.
61 |{{{http://www.xwiki.org/rel/properties}}}|The representation of the list of properties associated to the current resource.
62 |{{{http://www.xwiki.org/rel/modifications}}}|The representation of the list of modifications associated to the current resource.
63 |{{{http://www.xwiki.org/rel/children}}}|The representation of the list of children associated to the current resource.
64 |{{{http://www.xwiki.org/rel/tags}}}|The representation of the list of tags associated to the current resource.
65 |{{{http://www.xwiki.org/rel/tag}}}|The representation of a tag.
66 |{{{http://www.xwiki.org/rel/search}}}|The representation for a search resource.
Silvia Macovei 9.2 67
Silvia Macovei 8.3 68 Relations are defined as URIs in order to provide a sort of namespace. Currently these URIs are not links to real web pages but, in the future, they might point to descriptions of their semantics on actual web pages (or other kinds of representations).
Fabio Mancinelli 1.1 69
Vincent Massol 14.2 70 == The "HATEOAS" Graph ==
Fabio Mancinelli 1.1 71
Silvia Macovei 9.1 72 In order to better understand the relations among resources you might have a look at this [[graph>>attach:XWikiHATEOAS.pdf||]] that pictures all the resources available in the XWiki RESTful API and the relations among them. In this graph, nodes are [[URI templates>>http://bitworking.org/projects/URI-Templates/spec/draft-gregorio-uritemplate-03.txt]] representing classes of resources. Edges are the possible links that you might find in a representation of a given resource, and their associated relations.
Silvia Macovei 9.2 73
Fabio Mancinelli 1.1 74 This graph shows that by starting from the API entry-point a client can navigate and discover all the resources just by following the links provided in representations (and by knowing their semantics). This was exactly the way how this graph was generated.
75
Vincent Massol 14.2 76 = Interacting with the XWiki RESTful API =
Silvia Macovei 8.2 77
Oana Florea 9.5 78 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!
Silvia Macovei 9.1 79 If you want to write more complex programs you might download an HTTP library for your favorite language (e.g., [[http://hc.apache.org/]]).
Silvia Macovei 9.2 80
Silvia Macovei 9.1 81 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>>http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-rest/src/main/resources/xwiki.rest.model.xsd]], and use them for serializing and de-serializing XML representations.
Silvia Macovei 9.2 82
Fabio Mancinelli 5.1 83 If you use this approach (Apache HTTP Client + JAXB) you will find yourself writing some code like this:
Fabio Mancinelli 1.1 84
Fabio Mancinelli 19.1 85 {{code language="java"}}
86 import javax.xml.bind.JAXBContext;
87 import javax.xml.bind.Unmarshaller;
88
89 import org.apache.commons.httpclient.HttpClient;
90 import org.apache.commons.httpclient.methods.GetMethod;
91 import org.xwiki.rest.model.jaxb.Page;
92
93 ...
Fabio Mancinelli 1.1 94 HttpClient httpClient = new HttpClient();
Ludovic Dubost 18.1 95 JAXBContext context = JAXBContext.newInstance("org.xwiki.rest.model.jaxb");
Fabio Mancinelli 19.1 96 Unmarshaller unmarshaller = context.createUnmarshaller();
Fabio Mancinelli 1.1 97
98 GetMethod getMethod = new GetMethod("http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome");
99 getMethod.addRequestHeader("Accept", "application/xml");
100 httpClient.executeMethod(getMethod);
101
102 Page page = (Page) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());
Silvia Macovei 9.1 103 {{/code}}
Fabio Mancinelli 1.1 104
Fabio Mancinelli 5.1 105 And you will have all the information about the Main.WebHome page in the Page object, without the need of handling XML directly.
Silvia Macovei 9.2 106
Silvia Macovei 9.1 107 Because of the wide variety of HTTP frameworks available we don't provide a full tutorial about using them. However, in order to show you how to interact with the XWiki RESTful API, we will use [[curl>>http://curl.haxx.se]]: a standard command line HTTP client that provides an interface to all the functionalities of the HTTP protocol.
Silvia Macovei 9.2 108
Fabio Mancinelli 5.1 109 By using curl, the previous example would have been:
Fabio Mancinelli 1.1 110
Fabio Mancinelli 19.1 111 {{code language="xml"}}
Fabio Mancinelli 1.1 112 $ curl http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome
113 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
114 <page xmlns="http://www.xwiki.org">
115 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
116 ...
Silvia Macovei 9.1 117 {{/code}}
Fabio Mancinelli 1.1 118
Vincent Massol 14.2 119 == Authentication ==
Fabio Mancinelli 1.1 120
Fabio Mancinelli 5.1 121 The XWiki RESTful API supports two types of authentication:
Fabio Mancinelli 1.1 122
Silvia Macovei 9.1 123 * **HTTP BASIC Auth**: You provide your credentials using the Authorization HTTP header
124 * **XWiki session**: If you are logged in XWiki and you use the cookies provided by the authentication mechanism, you will also be authenticated to the XWiki RESTful API. This is useful, for example, when you are interacting with the API using the XMLHttpRequest object of a browser using Javascript.
Silvia Macovei 9.2 125
Fabio Mancinelli 5.1 126 If you don't provide any credentials the XWiki RESTful API will recognize you as a XWiki.Guest user.
Silvia Macovei 9.2 127
Fabio Mancinelli 5.1 128 So if you have, let's say a Main.PrivatePage, and you try to do:
Fabio Mancinelli 1.1 129
Silvia Macovei 10.6 130 {{code language="none"}}
Fabio Mancinelli 1.1 131 $ curl -v http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
132 ...
133 < HTTP/1.1 401 Unauthorized
134 ...
Silvia Macovei 9.1 135 {{/code}}
Fabio Mancinelli 1.1 136
Silvia Macovei 9.3 137 You will get an Unauthorized empty response.
Silvia Macovei 9.2 138
Fabio Mancinelli 1.1 139 On the contrary, by specifying Admin credentials you gain access to the actual page:
140
Fabio Mancinelli 19.1 141 {{code language="xml"}}
Fabio Mancinelli 1.1 142 $ curl -u Admin:admin http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
143 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
144 <page xmlns="http://www.xwiki.org">
145 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
146 ...
147 <content>Only admin can see this</content>
148 </page>
Silvia Macovei 9.1 149 {{/code}}
Fabio Mancinelli 1.1 150
Vincent Massol 14.2 151 == Sending representations ==
Fabio Mancinelli 1.1 152
153 Many resources are modifiable, so you can send representations in order to change the state of those resources (e.g., pages).
Silvia Macovei 9.1 154 All modifiable resources accept XML representations that conform to the [[XML Schema Definition>>http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-rest/src/main/resources/xwiki.rest.model.xsd]]. However, some other representations might be accepted as well (see the following sections).
Silvia Macovei 9.2 155
Fabio Mancinelli 1.1 156 Resource update is usually done by using the PUT method, while resource creation is done via PUT or POST.
Silvia Macovei 9.2 157
Fabio Mancinelli 1.1 158 For example, in order to create a page you might do the following:
159
Fabio Mancinelli 19.1 160 {{code language="xml"}}
Fabio Mancinelli 1.1 161 $ curl -u Admin:admin -X PUT -d "@newpage.xml" -H "Content-Type: application/xml" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/NewPage
162 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
163 <page xmlns="http://www.xwiki.org">
164 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
165 ...
166 <version>1.1</version>
167 <majorVersion>1</majorVersion>
168 <minorVersion>1</minorVersion>
169 <created>2009-03-21+01:00</created>
170 <creator>XWiki.Admin</creator>
171 <modified>2009-03-21+01:00</modified>
172 <modifier>XWiki.Admin</modifier>
173 <content>This is a new page</content>
174 </page>
Silvia Macovei 9.1 175 {{/code}}
Fabio Mancinelli 1.1 176
177 Where newpage.xml is an XML file containing
178
Fabio Mancinelli 19.1 179 {{code language="xml"}}
Fabio Mancinelli 1.1 180 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
181 <page xmlns="http://www.xwiki.org">
182 <title>Hello world</title>
183 <content>This is a new page</content>
184 </page>
Silvia Macovei 9.1 185 {{/code}}
Fabio Mancinelli 1.1 186
187 The page has been created and is accessible. Subsequent PUT requests to the page URI will modify its content.
188
Vincent Massol 14.2 189 == Overcoming browser limitations ==
Fabio Mancinelli 1.1 190
Silvia Macovei 10.4 191 As said before, it could be useful to send information by using browser's XmlHttpRequest objects. However, currently many browsers only support GET and POST methods, so it is impossible to send, for example, PUT requests. In order to overcome this limitation you can override the HTTP Method by specifying a ##method## parameter in the URI query string.
Silvia Macovei 9.2 192
Silvia Macovei 10.4 193 In the previous example, if you send a POST request to the ##[[http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/NewPage?method=PUT]]## it will be interpreted as if it were an actual PUT request.
Fabio Mancinelli 1.1 194
195 This overriding mechanism allows the interaction with the XWiki RESTful API by using any kind of browser.
196
Vincent Massol 14.2 197 == PUT vs POST ==
Fabio Mancinelli 1.1 198
Silvia Macovei 10.4 199 In the following sections you will see that sometimes resources are created by using PUT and sometimes by using POST. The general principle is that if the client is responsible for choosing the resource URI then PUT is used. If it's the server that bears this responsibility, then POST is used.
Fabio Mancinelli 1.1 200
Silvia Macovei 10.4 201 To be clearer, when a client wants to create a page it knows **where** that page should go, so it is able to communicate the server the target URI. PUT is used.
Fabio Mancinelli 1.1 202
Oana Florea 9.5 203 A client, on the contrary, cannot know beforehand what will be the URI of a comment, since comment URIs contains the ID of the comment and this information is generated by the server. In this case the client will do a POST and the server, in response, will communicate the URI it generated for the newly created comment.
Fabio Mancinelli 1.1 204
Vincent Massol 14.2 205 = XWiki RESTful API Documentation =
Silvia Macovei 8.4 206
Oana Florea 9.5 207 In this section you will find the documentation of the whole XWiki RESTful API.
Fabio Mancinelli 1.1 208
Silvia Macovei 9.1 209 **application/xml** representations refers to the XML Schema Definition at the following location: [[http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-rest/src/main/resources/xwiki.rest.model.xsd]]
Fabio Mancinelli 1.1 210
Silvia Macovei 9.1 211 Resource URIs are specified using [[URI templates>>http://bitworking.org/projects/URI-Templates/spec/draft-gregorio-uritemplate-03.txt]]. Bracketed elements are formal parameters and should be instantiated to actual values in order to retrieve the associated resource.
Fabio Mancinelli 1.1 212
Vincent Massol 14.2 213 == Root resources ==
Fabio Mancinelli 1.1 214
Vincent Massol 16.3 215 By defaut all the resources of the RESTful API are rooted at the following URI: ##http:~//server:port/xwiki/rest/## (depending on where your XWiki is running)
Fabio Mancinelli 16.1 216
Vincent Massol 14.2 217 === / ===
Silvia Macovei 9.1 218
219 * **HTTP Method:** GET
220 ** **Media types:**
Fabio Mancinelli 1.1 221 *** application/xml (XWiki element)
Silvia Macovei 9.1 222 ** **Description:** Retrieves the entry root description containing information about the server.
223 ** **Status codes:**
Fabio Mancinelli 1.1 224 *** 200: If the request was successful.
225
Vincent Massol 14.2 226 === /wikis ===
Silvia Macovei 9.1 227
228 * **HTTP Method:** GET
229 ** **Media types:**
Fabio Mancinelli 1.1 230 *** application/xml (Wikis element)
Silvia Macovei 9.1 231 ** **Description:** Retrieves the entry root description containing information about the server.
232 ** **Status codes:**
Fabio Mancinelli 1.1 233 *** 200: If the request was successful.
234
Vincent Massol 14.2 235 === /wikis/{wikiName}/search?q~={keywords}~[~[&scope~={name,content,title,objects}...~]&number~=n~] ===
Silvia Macovei 9.1 236
237 * **HTTP Method:** GET
238 ** **Media types:**
Fabio Mancinelli 1.1 239 *** application/xml (SearchResults element)
Silvia Macovei 9.1 240 ** **Description:** The list of pages and objects that contain the {keywords} in the specified {scope}s. Multiple scopes can be specified. Search results are relative to the whole {wikiName}
241 ** **Status codes:**
Fabio Mancinelli 1.1 242 *** 200: If the request was successful.
243
Vincent Massol 14.2 244 == Space resources ==
Fabio Mancinelli 1.1 245
Vincent Massol 14.2 246 === /wikis/{wikiName}/spaces[?start~=offset&number~=n] ===
Silvia Macovei 9.1 247
248 * **HTTP Method:** GET
249 ** **Media types:**
Fabio Mancinelli 1.1 250 *** application/xml (Spaces element)
Silvia Macovei 9.1 251 ** **Description:** Retrieves the list of spaces available in the {wikiName} wiki.
252 ** **Status codes:**
Fabio Mancinelli 1.1 253 *** 200: If the request was successful.
254
Vincent Massol 14.2 255 === /wikis/{wikiName}/spaces/{spaceName}/search?q~={keywords}~[~[&scope~={name,content,title,objects}...~]&number~=n~] ===
Silvia Macovei 9.1 256
257 * **HTTP Method:** GET
258 ** **Media types:**
Fabio Mancinelli 1.1 259 *** application/xml (Search results element)
Silvia Macovei 9.1 260 ** **Description:** The list of pages and objects that contain the {keywords} in the specified {scope}s. Multiple scopes can be specified. Search results are relative to space {spaceName}
261 ** **Status codes:**
Fabio Mancinelli 1.1 262 *** 200: If the request was successful.
263 *** 401: If the user is not authorized.
264
Vincent Massol 14.2 265 == Page resources ==
Fabio Mancinelli 1.1 266
Vincent Massol 14.2 267 === /wikis/{wikiName}/spaces/{spaceName}/pages[?start~=offset&number~=n] ===
Silvia Macovei 9.1 268
269 * **HTTP Method:** GET
270 ** **Media types:**
Fabio Mancinelli 1.1 271 *** application/xml (Pages element)
Silvia Macovei 9.1 272 ** **Description:** The list of pages in the space {spaceName}
273 ** **Status codes:**
Fabio Mancinelli 1.1 274 *** 200: If the request was successful
275 *** 401: If the user is not authorized.
276
Vincent Massol 14.2 277 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName} ===
Silvia Macovei 9.1 278
279 * **HTTP Method:** GET
280 ** **Media types:**
Fabio Mancinelli 1.1 281 *** application/xml (Page element)
Silvia Macovei 9.1 282 ** **Description:**
283 ** **Status codes:**
Fabio Mancinelli 1.1 284 *** 200: If the request was successful.
285 *** 401: If the user is not authorized.
Silvia Macovei 9.1 286
287 \\
288
289 * **HTTP Method:** PUT
290 ** **Accepted Media types:**
Fabio Mancinelli 1.1 291 *** application/xml (Page element)
292 *** text/plain (Only page content)
293 *** application/x-www-form-urlencoded (allowed field names: title, parent, content)
Silvia Macovei 9.1 294 ** **Media types:**
Fabio Mancinelli 1.1 295 *** application/xml (Page element)
Silvia Macovei 9.1 296 ** **Description:** Create or updates a page.
297 ** **Status codes:**
Fabio Mancinelli 1.1 298 *** 201: If the page was created.
299 *** 202: If the page was updated.
300 *** 304: If the page was not modified.
301 *** 401: If the user is not authorized.
Silvia Macovei 9.1 302
303 \\
304
305 * **HTTP Method:** DELETE
306 ** **Media types:**
Fabio Mancinelli 1.1 307 *** application/xml (Page element)
Silvia Macovei 9.1 308 ** **Description:** Delete the page.
309 ** **Status codes:**
Fabio Mancinelli 1.1 310 *** 204: If the request was successful.
311 *** 401: If the user is not authorized.
312
Vincent Massol 14.2 313 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history[?start~=offset&number~=n] ===
Silvia Macovei 9.1 314
315 * **HTTP Method:** GET
316 ** **Media types:**
Fabio Mancinelli 1.1 317 *** application/xml (History element)
Silvia Macovei 9.1 318 ** **Description:** The list of all the versions of the given page.
319 ** **Status codes:**
Fabio Mancinelli 1.1 320 *** 200: If the request was successful.
321 *** 401: If the user is not authorized.
322
Vincent Massol 14.2 323 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version} ===
Silvia Macovei 9.1 324
325 * **HTTP Method:** GET
326 ** **Media types:**
Fabio Mancinelli 1.1 327 *** application/xml (Page element)
Silvia Macovei 9.1 328 ** **Description:** The page at version {version}
329 ** **Status codes:**
Fabio Mancinelli 1.1 330 *** 200: If the request was successful.
331 *** 401: If the user is not authorized.
332
Silvia Macovei 10.1 333 ==== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations[?start~=offset&number~=n] ====
Silvia Macovei 9.1 334
335 * **HTTP Method:** GET
336 ** **Media types:**
Fabio Mancinelli 1.1 337 *** application/xml (Translations element)
Silvia Macovei 9.1 338 ** **Description:** The list of available translation for the page
339 ** **Status codes:**
Fabio Mancinelli 1.1 340 *** 200: If the request was successful.
341 *** 401: If the user is not authorized.
342
Vincent Massol 14.2 343 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{language} ===
Silvia Macovei 9.1 344
345 * **HTTP Method:** GET
346 ** **Media types:**
Fabio Mancinelli 1.1 347 *** application/xml (Page element)
Silvia Macovei 9.1 348 ** **Description:** The page at in the given {language}.
349 ** **Status codes:**
Fabio Mancinelli 1.1 350 *** 200: If the request was successful.
351 *** 401: If the user is not authorized.
Silvia Macovei 9.1 352
353 \\
354
355 * **HTTP Method:** PUT
356 ** **Accepted Media types:**
Fabio Mancinelli 1.1 357 *** application/xml (Page element)
358 *** text/plain (Only page content)
359 *** application/x-www-form-urlencoded (allowed field names: title, parent, content)
Silvia Macovei 9.1 360 ** **Media types:**
Fabio Mancinelli 1.1 361 *** application/xml (Page element)
Silvia Macovei 9.1 362 ** **Description:** Create or updates a page translation.
363 ** **Status codes:**
Fabio Mancinelli 1.1 364 *** 201: If the page was created.
365 *** 202: If the page was updated.
366 *** 304: If the page was not modified.
367 *** 401: If the user is not authorized.
Silvia Macovei 9.1 368
369 \\
370
371 * **HTTP Method:** DELETE
372 ** **Media types:**
Fabio Mancinelli 1.1 373 *** application/xml (Page element)
Silvia Macovei 9.1 374 ** **Description:** Delete the page translation.
375 ** **Status codes:**
Fabio Mancinelli 1.1 376 *** 204: If the request was successful.
377 *** 401: If the user is not authorized.
378
Vincent Massol 14.2 379 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{language}/history ===
Silvia Macovei 9.1 380
381 * **HTTP Method:** GET
382 ** **Media types:**
Fabio Mancinelli 1.1 383 *** application/xml (History element)
Silvia Macovei 9.1 384 ** **Description:** The list of all the available revisions of the page in a given {language}.
385 ** **Status codes:**
Fabio Mancinelli 1.1 386 *** 200: If the request was successful.
387 *** 401: If the user is not authorized.
388
Vincent Massol 14.2 389 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{lang}/history/{version} ===
Silvia Macovei 9.1 390
391 * **HTTP Method:** GET
392 ** **Media types:**
Fabio Mancinelli 1.1 393 *** application/xml (Page element)
Silvia Macovei 9.1 394 ** **Description:** A page at a given {version} in a given {language}.
395 ** **Status codes:**
Fabio Mancinelli 1.1 396 *** 200: If the request was successful.
397 *** 401: If the user is not authorized.
398
Vincent Massol 14.2 399 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/children ===
Silvia Macovei 9.1 400
401 * **HTTP Method:** GET
402 ** **Media types:**
Fabio Mancinelli 1.1 403 *** application/xml (Pages element)
Silvia Macovei 9.1 404 ** **Description:** The list of the children of a given page.
405 ** **Status codes:**
Fabio Mancinelli 1.1 406 *** 200: If the request was successful.
407 *** 401: If the user is not authorized.
408
Vincent Massol 14.2 409 == Tag resources ==
Fabio Mancinelli 1.1 410
Vincent Massol 14.2 411 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/tags ===
Silvia Macovei 9.1 412
413 * **HTTP Method:** GET
414 ** **Media types:**
Fabio Mancinelli 1.1 415 *** application/xml (Tags element)
Silvia Macovei 9.1 416 ** **Description:** List page tags.
417 ** **Status codes:**
Fabio Mancinelli 1.1 418 *** 200: If the request was successful.
419 *** 401: If the user is not authorized.
Silvia Macovei 9.1 420
421 \\
422
423 * **HTTP Method:** PUT
424 ** **Accepted Media types:**
Fabio Mancinelli 1.1 425 *** application/xml (Tag element)
426 *** text/plain
427 *** application/x-www-form-urlencoded (allowed field names: tag)
Silvia Macovei 9.1 428 ** **Media types:**
Fabio Mancinelli 1.1 429 *** application/xml (Tags element)
Silvia Macovei 9.1 430 ** **Description:** Add a tag to the page.
431 ** **Status codes:**
Fabio Mancinelli 1.1 432 *** 202: If the request was successful.
433 *** 401: If the user is not authorized.
434
Vincent Massol 14.2 435 === /wikis/{wikiName}/tags ===
Silvia Macovei 9.1 436
437 * **HTTP Method:** GET
438 ** **Media types:**
Fabio Mancinelli 1.1 439 *** application/xml (Tags element)
Silvia Macovei 9.1 440 ** **Description:** The list of all available tags
441 ** **Status codes:**
Fabio Mancinelli 1.1 442 *** 200: If the request was successful.
443 *** 401: If the user is not authorized.
444
Vincent Massol 14.2 445 === /wikis/{wikiName}/tags/{tag1}[,{tag2},{tag3}...][?start~=offset&number~=n] ===
Silvia Macovei 9.1 446
447 * **HTTP Method:** GET
448 ** **Media types:**
Fabio Mancinelli 1.1 449 *** application/xml (Pages element)
Silvia Macovei 9.1 450 ** **Description:** The list of pages having the specified tags.
451 ** **Status codes:**
Fabio Mancinelli 1.1 452 *** 200: If the request was successful.
453 *** 401: If the user is not authorized.
454
Vincent Massol 14.2 455 == Comments resources ==
Fabio Mancinelli 1.1 456
Vincent Massol 14.2 457 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/comments[?start~=offset&number~=n] ===
Silvia Macovei 9.1 458
459 * **HTTP Method:** GET
460 ** **Media types:**
Fabio Mancinelli 1.1 461 *** application/xml (Comments element)
Silvia Macovei 9.1 462 ** **Description:** The list of comments on a given page.
463 ** **Status codes:**
Fabio Mancinelli 1.1 464 *** 200: If the request was successful.
465 *** 401: If the user is not authorized.
Silvia Macovei 9.1 466
467 \\
468
469 * **HTTP Method:** POST
470 ** **Accepted Media types:**
Fabio Mancinelli 1.1 471 *** application/xml (Comment element)
472 *** text/plain
473 *** application/x-www-form-urlencoded (allowed field names: text)
Silvia Macovei 9.1 474 ** **Media types:**
Fabio Mancinelli 1.1 475 *** application/xml (Comment element)
Silvia Macovei 9.1 476 ** **Description:** Create a comment on the given page.
477 ** **Status codes:**
Fabio Mancinelli 1.1 478 *** 201: If the comment was created. (The Location header will contain the URI where the comment has been created.)
479 *** 401: If the user is not authorized.
480
Vincent Massol 14.2 481 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/comments/{commentId} ===
Silvia Macovei 9.1 482
483 * **HTTP Method:** GET
484 ** **Media types:**
Fabio Mancinelli 1.1 485 *** application/xml (Comment element)
Silvia Macovei 9.1 486 ** **Description:** A specific comment on a page
487 ** **Status codes:**
Fabio Mancinelli 1.1 488 *** 200: If the request was successful.
489 *** 401: If the user is not authorized.
490
Vincent Massol 14.2 491 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/comments ===
Silvia Macovei 9.1 492
493 * **HTTP Method:** GET
494 ** **Media types:**
Fabio Mancinelli 1.1 495 *** application/xml (Comments element)
Silvia Macovei 9.1 496 ** **Description:** The list of comments at a specific page {version}.
497 ** **Status codes:**
Fabio Mancinelli 1.1 498 *** 200: If the request was successful.
499 *** 401: If the user is not authorized.
500
Vincent Massol 14.2 501 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/comments/{commentId} ===
Silvia Macovei 9.1 502
503 * **HTTP Method:** GET
504 ** **Media types:**
Fabio Mancinelli 1.1 505 *** application/xml (Comment element)
Silvia Macovei 9.1 506 ** **Description:** A comment at a specific page {version}.
507 ** **Status codes:**
Fabio Mancinelli 1.1 508 *** 200: If the request was successful.
509 *** 401: If the user is not authorized.
510
Vincent Massol 14.2 511 == Attachments resources ==
Fabio Mancinelli 1.1 512
Vincent Massol 14.2 513 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments[?start~=offset&number~=n] ===
Silvia Macovei 9.1 514
515 * **HTTP Method:** GET
516 ** **Media types:**
Fabio Mancinelli 1.1 517 *** application/xml (Attachments element)
Silvia Macovei 9.1 518 ** **Description:** The list of attachments of a given page.
519 ** **Status codes:**
Fabio Mancinelli 1.1 520 *** 200: If the request was successful.
521 *** 401: If the user is not authorized.
522
Vincent Massol 14.2 523 === /wikis/{wikiName}/wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName} ===
Silvia Macovei 9.1 524
525 * **HTTP Method:** GET
526 ** **Media types:**
Fabio Mancinelli 1.1 527 *** The same of the attachment media type.
Silvia Macovei 9.1 528 ** **Description:** The attachment identified by {attachmentName} on a given page.
529 ** **Status codes:**
Fabio Mancinelli 1.1 530 *** 200: If the request was successful.
531 *** 401: If the user is not authorized.
Silvia Macovei 9.1 532
533 \\
534
535 * **HTTP Method:** PUT
536 ** **Accepted media types:**
537 *** **/**
538 ** **Media types:**
Fabio Mancinelli 1.1 539 *** application/xml (AttachmentSummary element)
Silvia Macovei 9.1 540 ** **Description:** Create an attachment identified by {attachmentName} on a given page.
541 ** **Status codes:**
Fabio Mancinelli 1.1 542 *** 201: If the attachment was created.
543 *** 202: If the attachment was updated.
544 *** 401: If the user is not authorized.
Silvia Macovei 9.1 545
546 \\
547
548 * **HTTP Method:** DELETE
549 ** **Media types:**
550 ** **Description:** Delete the attachment identified by {attachmentName} on a given page.
551 ** **Status codes:**
Fabio Mancinelli 1.1 552 *** 204: If the attachment was deleted.
553 *** 401: If the user is not authorized.
554
Vincent Massol 14.2 555 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/attachments[?start~=offset&number~=n] ===
Silvia Macovei 9.1 556
557 * **HTTP Method:** GET
558 ** **Media types:**
Fabio Mancinelli 1.1 559 *** application/xml (Attachments element)
Silvia Macovei 9.1 560 ** **Description:** The list of attachments at a given page {version}.
561 ** **Status codes:**
Fabio Mancinelli 1.1 562 *** 200: If the request was successful.
563 *** 401: If the user is not authorized.
564
Vincent Massol 14.2 565 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/attachments/{attachmentName} ===
Silvia Macovei 9.1 566
567 * **HTTP Method:** GET
568 ** **Media types:**
Fabio Mancinelli 1.1 569 *** The same of the attachment media type.
Silvia Macovei 9.1 570 ** **Description:** The attachment identified by {attachmentName} on a given page {version}.
571 ** **Status codes:**
Fabio Mancinelli 1.1 572 *** 200: If the request was successful.
573 *** 401: If the user is not authorized.
574
Vincent Massol 14.2 575 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName}/history ===
Silvia Macovei 9.1 576
577 * **HTTP Method:** GET
578 ** **Media types:**
Fabio Mancinelli 1.1 579 *** application/xml (??? element)
Silvia Macovei 9.1 580 ** **Description:** The list of available version for the {attachmentName}
581 ** **Status codes:**
Fabio Mancinelli 1.1 582 *** 200: If the request was successful.
583 *** 401: If the user is not authorized.
584
Vincent Massol 14.2 585 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName}/history/{version} ===
Silvia Macovei 9.1 586
587 * **HTTP Method:** GET
588 ** **Media types:**
Fabio Mancinelli 1.1 589 *** The same of the attachment media type.
Silvia Macovei 9.1 590 ** **Description:** The {attachmentName} at a given {version}
591 ** **Status codes:**
Fabio Mancinelli 1.1 592 *** 200: If the request was successful.
593 *** 401: If the user is not authorized.
594
Vincent Massol 14.2 595 == Object resources ==
Fabio Mancinelli 1.1 596
Vincent Massol 14.2 597 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects[?start~=offset&number~=n] ===
Silvia Macovei 9.1 598
599 * **HTTP Method:** GET
600 ** **Media types:**
Fabio Mancinelli 1.1 601 *** application/xml (Objects element)
Silvia Macovei 9.1 602 ** **Description:** The list of objects associated to a page.
603 ** **Status codes:**
Fabio Mancinelli 1.1 604 *** 200: If the request was successful.
605 *** 401: If the user is not authorized.
Silvia Macovei 9.1 606
607 \\
608
609 * **HTTP Method:** POST
610 ** **Accepted media types:**
Fabio Mancinelli 1.1 611 *** application/xml (Object element)
612 *** application/x-www-formurlencoded (a set of property#name=value pairs representing properties and a field className)
Silvia Macovei 9.1 613 ** **Media types:**
614 *** application/xml (Object element)
615 ** **Description:** Create a new object.
616 ** **Status codes:**
Fabio Mancinelli 1.1 617 *** 201: If the object was created (The Location header will contain the URI associated to the newly created object).
618 *** 401: If the user is not authorized.
619
Vincent Massol 14.2 620 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}[?start~=offset&number~=n] ===
Silvia Macovei 9.1 621
622 * **HTTP Method:** GET
623 ** **Media types:**
Fabio Mancinelli 1.1 624 *** application/xml (Objects element)
Silvia Macovei 9.1 625 ** **Description:** The list of objects of a given {className} associated to a page.
626 ** **Status codes:**
Fabio Mancinelli 1.1 627 *** 200: If the request was successful.
628 *** 401: If the user is not authorized.
629
Vincent Massol 14.2 630 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber} ===
Silvia Macovei 9.1 631
632 * **HTTP Method:** GET
633 ** **Media types:**
Fabio Mancinelli 1.1 634 *** application/xml (Object element)
Silvia Macovei 9.1 635 ** **Description:** The object of type {className} identified by {objectNumber} associated to the given page.
636 ** **Status codes:**
Fabio Mancinelli 1.1 637 *** 200: If the request was successful.
638 *** 401: If the user is not authorized.
Silvia Macovei 9.1 639
640 \\
641
642 * **HTTP Method:** PUT
643 ** **Accepted media types:**
Fabio Mancinelli 1.1 644 *** application/xml (Object element)
645 *** application/x-www-formurlencoded (a set of property#name=value pairs representing properties)
Silvia Macovei 9.1 646 ** **Media types:**
647 *** application/xml (Object element)
648 ** **Description:** Modify the object properties.
649 ** **Status codes:**
Fabio Mancinelli 1.1 650 *** 202: If the object was updated.
651 *** 401: If the user is not authorized.
Silvia Macovei 9.1 652
653 \\
654
655 * **HTTP Method:** DELETE
656 ** **Media types:**
657 ** **Description:** Delete the object.
658 ** **Status codes:**
Fabio Mancinelli 1.1 659 *** 204: If the object was deleted.
660 *** 401: If the user is not authorized.
661
Vincent Massol 14.2 662 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber}/properties ===
Silvia Macovei 9.1 663
664 * **HTTP Method:** GET
665 ** **Media types:**
Fabio Mancinelli 1.1 666 *** application/xml (Properties element)
Silvia Macovei 9.1 667 ** **Description:** The properties of the object of type {className} identified by {objectNumber} associated to the given page.
668 ** **Status codes:**
Fabio Mancinelli 1.1 669 *** 200: If the request was successful.
670 *** 401: If the user is not authorized.
671
Vincent Massol 14.2 672 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber}/properties/{propertyName} ===
Silvia Macovei 9.1 673
674 * **HTTP Method:** GET
675 ** **Media types:**
Fabio Mancinelli 1.1 676 *** application/xml (Properties element)
Silvia Macovei 9.1 677 ** **Description:** The property {propertyname} of the object of type {className} identified by {objectNumber} associated to the given page.
678 ** **Status codes:**
Fabio Mancinelli 1.1 679 *** 200: If the request was successful.
680 *** 401: If the user is not authorized.
Silvia Macovei 9.1 681
682 \\
683
684 * **HTTP Method:** PUT
685 ** **Accepted media types:**
Fabio Mancinelli 1.1 686 *** application/xml (Property element)
687 *** text/plain
688 *** application/x-www-formurlencoded (a field property#name=value pairs representing a property)
Silvia Macovei 9.1 689 ** **Media types:**
690 *** application/xml (Property element)
691 ** **Description:** Modify the object properties.
692 ** **Status codes:**
Fabio Mancinelli 1.1 693 *** 202: If the object was updated.
694 *** 401: If the user is not authorized.
695
Vincent Massol 14.2 696 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects[?start~=offset&number~=n] ===
Silvia Macovei 9.1 697
698 * **HTTP Method:** GET
699 ** **Media types:**
Fabio Mancinelli 1.1 700 *** application/xml (Objects element)
Silvia Macovei 9.1 701 ** **Description:** The list of objects associated to a page at a given {version}.
702 ** **Status codes:**
Fabio Mancinelli 1.1 703 *** 200: If the request was successful.
704 *** 401: If the user is not authorized.
705
Vincent Massol 14.2 706 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber} ===
Silvia Macovei 9.1 707
708 * **HTTP Method:** GET
709 ** **Media types:**
Fabio Mancinelli 1.1 710 *** application/xml (Object element)
Silvia Macovei 9.1 711 ** **Description:** The object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
712 ** **Status codes:**
Fabio Mancinelli 1.1 713 *** 200: If the request was successful.
714 *** 401: If the user is not authorized.
715
Vincent Massol 14.2 716 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties ===
Silvia Macovei 9.1 717
718 * **HTTP Method:** GET
719 ** **Media types:**
Fabio Mancinelli 1.1 720 *** application/xml (Properties element)
Silvia Macovei 9.1 721 ** **Description:** The properties of the object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
722 ** **Status codes:**
Fabio Mancinelli 1.1 723 *** 200: If the request was successful.
724 *** 401: If the user is not authorized.
725
Vincent Massol 14.2 726 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties/{propertyName} ===
Silvia Macovei 9.1 727
728 * **HTTP Method:** GET
729 ** **Media types:**
Fabio Mancinelli 1.1 730 *** application/xml (Properties element)
Silvia Macovei 9.1 731 ** **Description:** The property {propertyname} of the object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
732 ** **Status codes:**
Fabio Mancinelli 1.1 733 *** 200: If the request was successful.
734 *** 401: If the user is not authorized.
735
Vincent Massol 14.2 736 === /wikis/{wikiName}/class/{className}/objects ===
Silvia Macovei 9.1 737
738 * **HTTP Method:** GET
739 ** **Media types:**
Fabio Mancinelli 1.1 740 *** application/xml (Objects element)
Silvia Macovei 9.1 741 ** **Description:** The list of all the objects of a given {className}.
742 ** **Status codes:**
Fabio Mancinelli 1.1 743 *** 200: If the request was successful.
744 *** 401: If the user is not authorized.
745
Vincent Massol 14.2 746 == Class resources ==
Fabio Mancinelli 1.1 747
Vincent Massol 14.2 748 === /wikis/{wikiName}/classes[?start~=offset&number~=n] ===
Silvia Macovei 9.1 749
750 * **HTTP Method:** GET
751 ** **Media types:**
Fabio Mancinelli 1.1 752 *** application/xml (Classes element)
Silvia Macovei 9.1 753 ** **Description:** The list of all the classes defined in the wiki {wikiName}
754 ** **Status codes:**
Fabio Mancinelli 1.1 755 *** 200: If the request was successful.
756 *** 401: If the user is not authorized.
757
Vincent Massol 14.2 758 === /wikis/{wikiName}/classes/{className} ===
Silvia Macovei 9.1 759
760 * **HTTP Method:** GET
761 ** **Media types:**
Fabio Mancinelli 1.1 762 *** application/xml (Class element)
Silvia Macovei 9.1 763 ** **Description:** The {className} definition
764 ** **Status codes:**
Fabio Mancinelli 1.1 765 *** 200: If the request was successful.
766 *** 401: If the user is not authorized.
767
Vincent Massol 14.2 768 === /wikis/{wikiName}/classes/{className}/properties ===
Silvia Macovei 9.1 769
770 * **HTTP Method:** GET
771 ** **Media types:**
Fabio Mancinelli 1.1 772 *** application/xml (Properties element)
Silvia Macovei 9.1 773 ** **Description:** The properties of the class {className}.
774 ** **Status codes:**
Fabio Mancinelli 1.1 775 *** 200: If the request was successful.
776 *** 401: If the user is not authorized.
777
Vincent Massol 14.2 778 === /wikis/{wikiName}/classes/{className}/properties/{property} ===
Silvia Macovei 9.1 779
780 * **HTTP Method:** GET
781 ** **Media types:**
Fabio Mancinelli 1.1 782 *** application/xml (Property element)
Silvia Macovei 9.1 783 ** **Description:** The property {property} of the class {className}.
784 ** **Status codes:**
Fabio Mancinelli 1.1 785 *** 200: If the request was successful.
786 *** 401: If the user is not authorized.
787
Vincent Massol 14.2 788 == Other resources ==
Fabio Mancinelli 1.1 789
Vincent Massol 14.2 790 === /wikis/{wikiName}/modifications[?start~=offset&number~=n&timestamp~=t] ===
Silvia Macovei 9.1 791
792 * **HTTP Method:** GET
793 ** **Media types:**
Fabio Mancinelli 1.1 794 *** application/xml (Modifications element)
Silvia Macovei 9.1 795 ** **Description:** The list of the latest modification made to the wiki {wikiName} starting from time t (t is expressed in milliseconds from 1970 of the starting date)
796 ** **Status codes:**
Fabio Mancinelli 1.1 797 *** 200: If the request was successful.
798 *** 401: If the user is not authorized.

Get Connected