Wiki source code of The XWiki RESTful API

Version 26.2 by Vincent Massol on 2011/01/19

Hide last authors
Jerome 20.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc depth="2"/}}
3 {{/box}}
Fabio Mancinelli 1.1 4
Silvia Macovei 10.5 5 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 6
Jerome 20.1 7 = Accessing the service =
Fabio Mancinelli 16.1 8
Fabio Mancinelli 17.1 9 By defaut the XWiki RESTful API entrypoint is rooted at the following URI:
10
11 {{code}}
12
13 http://host:port/xwiki/rest
14
15 {{/code}}
16
Vincent Massol 17.2 17 All the resource references described in the [[XWiki RESTful API Documentation>>#HXWikiRESTfulAPIDocumentation]] should be intended relative to this URL.
Fabio Mancinelli 17.1 18
Jerome 20.1 19 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##
Fabio Mancinelli 17.1 20
Vincent Massol 26.2 21 In addition to retrieving content in XML format, you can also retrieve it in JSON format by adding the parameter ##?media=json## in the URL. For example: ##http:~/~/localhost:8080/xwiki/rest/wikis?media=json##
Ludovic Dubost 25.1 22
Vincent Massol 14.2 23 = Dataset =
Fabio Mancinelli 1.1 24
25 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.
26
Silvia Macovei 10.3 27 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 28
Vincent Massol 14.2 29 = Understanding resources and representations =
Fabio Mancinelli 1.1 30
Silvia Macovei 10.4 31 "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 32
Silvia Macovei 9.1 33 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 34
Silvia Macovei 10.4 35 Of course the same resource can be represented in many different ways. This is yet to be documented.
Fabio Mancinelli 1.1 36
Silvia Macovei 10.4 37 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 38
Fabio Mancinelli 1.1 39 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 40
Silvia Macovei 9.1 41 [[image:representation||height="430"]]
Fabio Mancinelli 1.1 42
Vincent Massol 14.2 43 == Relations ==
Fabio Mancinelli 1.1 44
Fabio Mancinelli 5.1 45 The available relations that you might find in the XML resource representations are the following:
Fabio Mancinelli 1.1 46
Silvia Macovei 9.1 47 |=Rel|=Semantics
Fabio Mancinelli 15.1 48 |{{{http://www.xwiki.org/rel/wikis}}}|The representation containing the list of virtual wikis.
49 |{{{http://www.xwiki.org/rel/spaces}}}|The representation containing the list of spaces in a wiki.
50 |{{{http://www.xwiki.org/rel/pages}}}|The representation containing the list of pages in a space.
51 |{{{http://www.xwiki.org/rel/translation}}}|The representation containing a translation of a page.
52 |{{{http://www.xwiki.org/rel/page}}}|The representation for a page.
53 |{{{http://www.xwiki.org/rel/space}}}|The representation for a space.
54 |{{{http://www.xwiki.org/rel/parent}}}|The representation for the page that is parent of the current resource.
55 |{{{http://www.xwiki.org/rel/home}}}|The representation for the page that is the home of the current resource.
56 |{{{http://www.xwiki.org/rel/attachmentData}}}|The representation of the actual attachment data.
57 |{{{http://www.xwiki.org/rel/comments}}}|The representation of the list of comments associated to the current resource.
58 |{{{http://www.xwiki.org/rel/attachments}}}|The representation of the list of attachments associated to the current resource.
59 |{{{http://www.xwiki.org/rel/objects}}}|The representation of the list of objects associated to the current resource.
60 |{{{http://www.xwiki.org/rel/object}}}|The representation for an object.
61 |{{{http://www.xwiki.org/rel/classes}}}|The representation of the list of classes associated to the current resource.
62 |{{{http://www.xwiki.org/rel/history}}}|The representation of the list of history information associated to the current resource.
63 |{{{http://www.xwiki.org/rel/class}}}|The representation for a class.
64 |{{{http://www.xwiki.org/rel/property}}}|The representation for a property.
65 |{{{http://www.xwiki.org/rel/properties}}}|The representation of the list of properties associated to the current resource.
66 |{{{http://www.xwiki.org/rel/modifications}}}|The representation of the list of modifications associated to the current resource.
67 |{{{http://www.xwiki.org/rel/children}}}|The representation of the list of children associated to the current resource.
68 |{{{http://www.xwiki.org/rel/tags}}}|The representation of the list of tags associated to the current resource.
69 |{{{http://www.xwiki.org/rel/tag}}}|The representation of a tag.
70 |{{{http://www.xwiki.org/rel/search}}}|The representation for a search resource.
Silvia Macovei 9.2 71
Silvia Macovei 8.3 72 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 73
Vincent Massol 14.2 74 == The "HATEOAS" Graph ==
Fabio Mancinelli 1.1 75
Jerome 20.1 76 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 77
Fabio Mancinelli 1.1 78 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.
79
Vincent Massol 14.2 80 = Interacting with the XWiki RESTful API =
Silvia Macovei 8.2 81
Oana Florea 9.5 82 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 83 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 84
Silvia Macovei 9.1 85 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 86
Fabio Mancinelli 5.1 87 If you use this approach (Apache HTTP Client + JAXB) you will find yourself writing some code like this:
Fabio Mancinelli 1.1 88
Fabio Mancinelli 19.1 89 {{code language="java"}}
90 import javax.xml.bind.JAXBContext;
91 import javax.xml.bind.Unmarshaller;
92
93 import org.apache.commons.httpclient.HttpClient;
94 import org.apache.commons.httpclient.methods.GetMethod;
95 import org.xwiki.rest.model.jaxb.Page;
96
97 ...
Fabio Mancinelli 1.1 98 HttpClient httpClient = new HttpClient();
Ludovic Dubost 18.1 99 JAXBContext context = JAXBContext.newInstance("org.xwiki.rest.model.jaxb");
Fabio Mancinelli 19.1 100 Unmarshaller unmarshaller = context.createUnmarshaller();
Fabio Mancinelli 1.1 101
102 GetMethod getMethod = new GetMethod("http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome");
103 getMethod.addRequestHeader("Accept", "application/xml");
104 httpClient.executeMethod(getMethod);
105
106 Page page = (Page) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());
Silvia Macovei 9.1 107 {{/code}}
Fabio Mancinelli 1.1 108
Fabio Mancinelli 5.1 109 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 110
Silvia Macovei 9.1 111 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 112
Fabio Mancinelli 5.1 113 By using curl, the previous example would have been:
Fabio Mancinelli 1.1 114
Fabio Mancinelli 19.1 115 {{code language="xml"}}
Fabio Mancinelli 1.1 116 $ curl http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome
117 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
118 <page xmlns="http://www.xwiki.org">
119 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
120 ...
Silvia Macovei 9.1 121 {{/code}}
Fabio Mancinelli 1.1 122
Vincent Massol 14.2 123 == Authentication ==
Fabio Mancinelli 1.1 124
Fabio Mancinelli 5.1 125 The XWiki RESTful API supports two types of authentication:
Fabio Mancinelli 1.1 126
Silvia Macovei 9.1 127 * **HTTP BASIC Auth**: You provide your credentials using the Authorization HTTP header
128 * **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 129
Fabio Mancinelli 5.1 130 If you don't provide any credentials the XWiki RESTful API will recognize you as a XWiki.Guest user.
Silvia Macovei 9.2 131
Fabio Mancinelli 5.1 132 So if you have, let's say a Main.PrivatePage, and you try to do:
Fabio Mancinelli 1.1 133
Silvia Macovei 10.6 134 {{code language="none"}}
Fabio Mancinelli 1.1 135 $ curl -v http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
136 ...
137 < HTTP/1.1 401 Unauthorized
138 ...
Silvia Macovei 9.1 139 {{/code}}
Fabio Mancinelli 1.1 140
Silvia Macovei 9.3 141 You will get an Unauthorized empty response.
Silvia Macovei 9.2 142
Fabio Mancinelli 1.1 143 On the contrary, by specifying Admin credentials you gain access to the actual page:
144
Fabio Mancinelli 19.1 145 {{code language="xml"}}
Fabio Mancinelli 1.1 146 $ curl -u Admin:admin http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
147 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
148 <page xmlns="http://www.xwiki.org">
149 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
150 ...
151 <content>Only admin can see this</content>
152 </page>
Silvia Macovei 9.1 153 {{/code}}
Fabio Mancinelli 1.1 154
Vincent Massol 14.2 155 == Sending representations ==
Fabio Mancinelli 1.1 156
157 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 158 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 159
Fabio Mancinelli 1.1 160 Resource update is usually done by using the PUT method, while resource creation is done via PUT or POST.
Silvia Macovei 9.2 161
Fabio Mancinelli 1.1 162 For example, in order to create a page you might do the following:
163
Fabio Mancinelli 19.1 164 {{code language="xml"}}
Sergiu Dumitriu 20.2 165 $ curl -u Admin:admin -X PUT --data-binary "@newpage.xml" -H "Content-Type: application/xml" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/NewPage
Fabio Mancinelli 1.1 166 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
167 <page xmlns="http://www.xwiki.org">
168 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
169 ...
170 <version>1.1</version>
171 <majorVersion>1</majorVersion>
172 <minorVersion>1</minorVersion>
173 <created>2009-03-21+01:00</created>
174 <creator>XWiki.Admin</creator>
175 <modified>2009-03-21+01:00</modified>
176 <modifier>XWiki.Admin</modifier>
177 <content>This is a new page</content>
178 </page>
Silvia Macovei 9.1 179 {{/code}}
Fabio Mancinelli 1.1 180
181 Where newpage.xml is an XML file containing
182
Fabio Mancinelli 19.1 183 {{code language="xml"}}
Fabio Mancinelli 1.1 184 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
185 <page xmlns="http://www.xwiki.org">
186 <title>Hello world</title>
187 <content>This is a new page</content>
188 </page>
Silvia Macovei 9.1 189 {{/code}}
Fabio Mancinelli 1.1 190
191 The page has been created and is accessible. Subsequent PUT requests to the page URI will modify its content.
192
Vincent Massol 14.2 193 == Overcoming browser limitations ==
Fabio Mancinelli 1.1 194
Silvia Macovei 10.4 195 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 196
Silvia Macovei 10.4 197 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 198
199 This overriding mechanism allows the interaction with the XWiki RESTful API by using any kind of browser.
200
Vincent Massol 14.2 201 == PUT vs POST ==
Fabio Mancinelli 1.1 202
Silvia Macovei 10.4 203 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 204
Silvia Macovei 10.4 205 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 206
Oana Florea 9.5 207 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 208
Vincent Massol 14.2 209 = XWiki RESTful API Documentation =
Silvia Macovei 8.4 210
Oana Florea 9.5 211 In this section you will find the documentation of the whole XWiki RESTful API.
Fabio Mancinelli 1.1 212
Silvia Macovei 9.1 213 **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 214
Silvia Macovei 9.1 215 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 216
Vincent Massol 14.2 217 == Root resources ==
Fabio Mancinelli 1.1 218
Jerome 20.1 219 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 220
Vincent Massol 14.2 221 === / ===
Silvia Macovei 9.1 222
223 * **HTTP Method:** GET
224 ** **Media types:**
Fabio Mancinelli 1.1 225 *** application/xml (XWiki element)
Silvia Macovei 9.1 226 ** **Description:** Retrieves the entry root description containing information about the server.
227 ** **Status codes:**
Fabio Mancinelli 1.1 228 *** 200: If the request was successful.
229
Vincent Massol 14.2 230 === /wikis ===
Silvia Macovei 9.1 231
232 * **HTTP Method:** GET
233 ** **Media types:**
Fabio Mancinelli 1.1 234 *** application/xml (Wikis element)
Silvia Macovei 9.1 235 ** **Description:** Retrieves the entry root description containing information about the server.
236 ** **Status codes:**
Fabio Mancinelli 1.1 237 *** 200: If the request was successful.
238
Jerome 20.1 239 === /wikis/{wikiName}/search?q~={keywords}~[~[&scope~={name,content,title,objects}...]&number~=n] ===
Silvia Macovei 9.1 240
241 * **HTTP Method:** GET
242 ** **Media types:**
Fabio Mancinelli 1.1 243 *** application/xml (SearchResults element)
Silvia Macovei 9.1 244 ** **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}
245 ** **Status codes:**
Fabio Mancinelli 1.1 246 *** 200: If the request was successful.
247
Vincent Massol 14.2 248 == Space resources ==
Fabio Mancinelli 1.1 249
Vincent Massol 14.2 250 === /wikis/{wikiName}/spaces[?start~=offset&number~=n] ===
Silvia Macovei 9.1 251
252 * **HTTP Method:** GET
253 ** **Media types:**
Fabio Mancinelli 1.1 254 *** application/xml (Spaces element)
Silvia Macovei 9.1 255 ** **Description:** Retrieves the list of spaces available in the {wikiName} wiki.
256 ** **Status codes:**
Fabio Mancinelli 1.1 257 *** 200: If the request was successful.
258
Jerome 20.1 259 === /wikis/{wikiName}/spaces/{spaceName}/search?q~={keywords}~[~[&scope~={name,content,title,objects}...]&number~=n] ===
Silvia Macovei 9.1 260
261 * **HTTP Method:** GET
262 ** **Media types:**
Fabio Mancinelli 1.1 263 *** application/xml (Search results element)
Silvia Macovei 9.1 264 ** **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}
265 ** **Status codes:**
Fabio Mancinelli 1.1 266 *** 200: If the request was successful.
267 *** 401: If the user is not authorized.
268
Vincent Massol 14.2 269 == Page resources ==
Fabio Mancinelli 1.1 270
Vincent Massol 14.2 271 === /wikis/{wikiName}/spaces/{spaceName}/pages[?start~=offset&number~=n] ===
Silvia Macovei 9.1 272
273 * **HTTP Method:** GET
274 ** **Media types:**
Fabio Mancinelli 1.1 275 *** application/xml (Pages element)
Silvia Macovei 9.1 276 ** **Description:** The list of pages in the space {spaceName}
277 ** **Status codes:**
Fabio Mancinelli 1.1 278 *** 200: If the request was successful
279 *** 401: If the user is not authorized.
280
Vincent Massol 14.2 281 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName} ===
Silvia Macovei 9.1 282
283 * **HTTP Method:** GET
284 ** **Media types:**
Fabio Mancinelli 1.1 285 *** application/xml (Page element)
Silvia Macovei 9.1 286 ** **Description:**
287 ** **Status codes:**
Fabio Mancinelli 1.1 288 *** 200: If the request was successful.
289 *** 401: If the user is not authorized.
Silvia Macovei 9.1 290
291 \\
292
293 * **HTTP Method:** PUT
294 ** **Accepted Media types:**
Fabio Mancinelli 1.1 295 *** application/xml (Page element)
296 *** text/plain (Only page content)
297 *** application/x-www-form-urlencoded (allowed field names: title, parent, content)
Silvia Macovei 9.1 298 ** **Media types:**
Fabio Mancinelli 1.1 299 *** application/xml (Page element)
Silvia Macovei 9.1 300 ** **Description:** Create or updates a page.
301 ** **Status codes:**
Fabio Mancinelli 1.1 302 *** 201: If the page was created.
303 *** 202: If the page was updated.
304 *** 304: If the page was not modified.
305 *** 401: If the user is not authorized.
Silvia Macovei 9.1 306
307 \\
308
309 * **HTTP Method:** DELETE
310 ** **Media types:**
Fabio Mancinelli 1.1 311 *** application/xml (Page element)
Silvia Macovei 9.1 312 ** **Description:** Delete the page.
313 ** **Status codes:**
Fabio Mancinelli 1.1 314 *** 204: If the request was successful.
315 *** 401: If the user is not authorized.
316
Vincent Massol 14.2 317 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history[?start~=offset&number~=n] ===
Silvia Macovei 9.1 318
319 * **HTTP Method:** GET
320 ** **Media types:**
Fabio Mancinelli 1.1 321 *** application/xml (History element)
Silvia Macovei 9.1 322 ** **Description:** The list of all the versions of the given page.
323 ** **Status codes:**
Fabio Mancinelli 1.1 324 *** 200: If the request was successful.
325 *** 401: If the user is not authorized.
326
Vincent Massol 14.2 327 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version} ===
Silvia Macovei 9.1 328
329 * **HTTP Method:** GET
330 ** **Media types:**
Fabio Mancinelli 1.1 331 *** application/xml (Page element)
Silvia Macovei 9.1 332 ** **Description:** The page at version {version}
333 ** **Status codes:**
Fabio Mancinelli 1.1 334 *** 200: If the request was successful.
335 *** 401: If the user is not authorized.
336
Silvia Macovei 10.1 337 ==== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations[?start~=offset&number~=n] ====
Silvia Macovei 9.1 338
339 * **HTTP Method:** GET
340 ** **Media types:**
Fabio Mancinelli 1.1 341 *** application/xml (Translations element)
Silvia Macovei 9.1 342 ** **Description:** The list of available translation for the page
343 ** **Status codes:**
Fabio Mancinelli 1.1 344 *** 200: If the request was successful.
345 *** 401: If the user is not authorized.
346
Vincent Massol 14.2 347 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{language} ===
Silvia Macovei 9.1 348
349 * **HTTP Method:** GET
350 ** **Media types:**
Fabio Mancinelli 1.1 351 *** application/xml (Page element)
Silvia Macovei 9.1 352 ** **Description:** The page at in the given {language}.
353 ** **Status codes:**
Fabio Mancinelli 1.1 354 *** 200: If the request was successful.
355 *** 401: If the user is not authorized.
Silvia Macovei 9.1 356
357 \\
358
359 * **HTTP Method:** PUT
360 ** **Accepted Media types:**
Fabio Mancinelli 1.1 361 *** application/xml (Page element)
362 *** text/plain (Only page content)
363 *** application/x-www-form-urlencoded (allowed field names: title, parent, content)
Silvia Macovei 9.1 364 ** **Media types:**
Fabio Mancinelli 1.1 365 *** application/xml (Page element)
Silvia Macovei 9.1 366 ** **Description:** Create or updates a page translation.
367 ** **Status codes:**
Fabio Mancinelli 1.1 368 *** 201: If the page was created.
369 *** 202: If the page was updated.
370 *** 304: If the page was not modified.
371 *** 401: If the user is not authorized.
Silvia Macovei 9.1 372
373 \\
374
375 * **HTTP Method:** DELETE
376 ** **Media types:**
Fabio Mancinelli 1.1 377 *** application/xml (Page element)
Silvia Macovei 9.1 378 ** **Description:** Delete the page translation.
379 ** **Status codes:**
Fabio Mancinelli 1.1 380 *** 204: If the request was successful.
381 *** 401: If the user is not authorized.
382
Vincent Massol 14.2 383 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{language}/history ===
Silvia Macovei 9.1 384
385 * **HTTP Method:** GET
386 ** **Media types:**
Fabio Mancinelli 1.1 387 *** application/xml (History element)
Silvia Macovei 9.1 388 ** **Description:** The list of all the available revisions of the page in a given {language}.
389 ** **Status codes:**
Fabio Mancinelli 1.1 390 *** 200: If the request was successful.
391 *** 401: If the user is not authorized.
392
Vincent Massol 14.2 393 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{lang}/history/{version} ===
Silvia Macovei 9.1 394
395 * **HTTP Method:** GET
396 ** **Media types:**
Fabio Mancinelli 1.1 397 *** application/xml (Page element)
Silvia Macovei 9.1 398 ** **Description:** A page at a given {version} in a given {language}.
399 ** **Status codes:**
Fabio Mancinelli 1.1 400 *** 200: If the request was successful.
401 *** 401: If the user is not authorized.
402
Vincent Massol 14.2 403 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/children ===
Silvia Macovei 9.1 404
405 * **HTTP Method:** GET
406 ** **Media types:**
Fabio Mancinelli 1.1 407 *** application/xml (Pages element)
Silvia Macovei 9.1 408 ** **Description:** The list of the children of a given page.
409 ** **Status codes:**
Fabio Mancinelli 1.1 410 *** 200: If the request was successful.
411 *** 401: If the user is not authorized.
412
Vincent Massol 14.2 413 == Tag resources ==
Fabio Mancinelli 1.1 414
Vincent Massol 14.2 415 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/tags ===
Silvia Macovei 9.1 416
417 * **HTTP Method:** GET
418 ** **Media types:**
Fabio Mancinelli 1.1 419 *** application/xml (Tags element)
Silvia Macovei 9.1 420 ** **Description:** List page tags.
421 ** **Status codes:**
Fabio Mancinelli 1.1 422 *** 200: If the request was successful.
423 *** 401: If the user is not authorized.
Silvia Macovei 9.1 424
425 \\
426
427 * **HTTP Method:** PUT
428 ** **Accepted Media types:**
Fabio Mancinelli 1.1 429 *** application/xml (Tag element)
430 *** text/plain
431 *** application/x-www-form-urlencoded (allowed field names: tag)
Silvia Macovei 9.1 432 ** **Media types:**
Fabio Mancinelli 1.1 433 *** application/xml (Tags element)
Silvia Macovei 9.1 434 ** **Description:** Add a tag to the page.
435 ** **Status codes:**
Fabio Mancinelli 1.1 436 *** 202: If the request was successful.
437 *** 401: If the user is not authorized.
438
Vincent Massol 14.2 439 === /wikis/{wikiName}/tags ===
Silvia Macovei 9.1 440
441 * **HTTP Method:** GET
442 ** **Media types:**
Fabio Mancinelli 1.1 443 *** application/xml (Tags element)
Silvia Macovei 9.1 444 ** **Description:** The list of all available tags
445 ** **Status codes:**
Fabio Mancinelli 1.1 446 *** 200: If the request was successful.
447 *** 401: If the user is not authorized.
448
Vincent Massol 14.2 449 === /wikis/{wikiName}/tags/{tag1}[,{tag2},{tag3}...][?start~=offset&number~=n] ===
Silvia Macovei 9.1 450
451 * **HTTP Method:** GET
452 ** **Media types:**
Fabio Mancinelli 1.1 453 *** application/xml (Pages element)
Silvia Macovei 9.1 454 ** **Description:** The list of pages having the specified tags.
455 ** **Status codes:**
Fabio Mancinelli 1.1 456 *** 200: If the request was successful.
457 *** 401: If the user is not authorized.
458
Vincent Massol 14.2 459 == Comments resources ==
Fabio Mancinelli 1.1 460
Vincent Massol 14.2 461 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/comments[?start~=offset&number~=n] ===
Silvia Macovei 9.1 462
463 * **HTTP Method:** GET
464 ** **Media types:**
Fabio Mancinelli 1.1 465 *** application/xml (Comments element)
Silvia Macovei 9.1 466 ** **Description:** The list of comments on a given page.
467 ** **Status codes:**
Fabio Mancinelli 1.1 468 *** 200: If the request was successful.
469 *** 401: If the user is not authorized.
Silvia Macovei 9.1 470
471 \\
472
473 * **HTTP Method:** POST
474 ** **Accepted Media types:**
Fabio Mancinelli 1.1 475 *** application/xml (Comment element)
476 *** text/plain
Jerome 20.1 477 *** application/x-www-form-urlencoded - allowed field names: ##text##, ##replyTo## (object number of the replied comment, since XE 2.3)
Silvia Macovei 9.1 478 ** **Media types:**
Fabio Mancinelli 1.1 479 *** application/xml (Comment element)
Silvia Macovei 9.1 480 ** **Description:** Create a comment on the given page.
481 ** **Status codes:**
Fabio Mancinelli 1.1 482 *** 201: If the comment was created. (The Location header will contain the URI where the comment has been created.)
483 *** 401: If the user is not authorized.
484
Vincent Massol 14.2 485 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/comments/{commentId} ===
Silvia Macovei 9.1 486
487 * **HTTP Method:** GET
488 ** **Media types:**
Fabio Mancinelli 1.1 489 *** application/xml (Comment element)
Silvia Macovei 9.1 490 ** **Description:** A specific comment on a page
491 ** **Status codes:**
Fabio Mancinelli 1.1 492 *** 200: If the request was successful.
493 *** 401: If the user is not authorized.
494
Vincent Massol 14.2 495 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/comments ===
Silvia Macovei 9.1 496
497 * **HTTP Method:** GET
498 ** **Media types:**
Fabio Mancinelli 1.1 499 *** application/xml (Comments element)
Silvia Macovei 9.1 500 ** **Description:** The list of comments at a specific page {version}.
501 ** **Status codes:**
Fabio Mancinelli 1.1 502 *** 200: If the request was successful.
503 *** 401: If the user is not authorized.
504
Vincent Massol 14.2 505 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/comments/{commentId} ===
Silvia Macovei 9.1 506
507 * **HTTP Method:** GET
508 ** **Media types:**
Fabio Mancinelli 1.1 509 *** application/xml (Comment element)
Silvia Macovei 9.1 510 ** **Description:** A comment at a specific page {version}.
511 ** **Status codes:**
Fabio Mancinelli 1.1 512 *** 200: If the request was successful.
513 *** 401: If the user is not authorized.
514
Vincent Massol 14.2 515 == Attachments resources ==
Fabio Mancinelli 1.1 516
Vincent Massol 14.2 517 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments[?start~=offset&number~=n] ===
Silvia Macovei 9.1 518
519 * **HTTP Method:** GET
520 ** **Media types:**
Fabio Mancinelli 1.1 521 *** application/xml (Attachments element)
Silvia Macovei 9.1 522 ** **Description:** The list of attachments of a given page.
523 ** **Status codes:**
Fabio Mancinelli 1.1 524 *** 200: If the request was successful.
525 *** 401: If the user is not authorized.
526
Vincent Massol 14.2 527 === /wikis/{wikiName}/wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName} ===
Silvia Macovei 9.1 528
529 * **HTTP Method:** GET
530 ** **Media types:**
Fabio Mancinelli 1.1 531 *** The same of the attachment media type.
Silvia Macovei 9.1 532 ** **Description:** The attachment identified by {attachmentName} on a given page.
533 ** **Status codes:**
Fabio Mancinelli 1.1 534 *** 200: If the request was successful.
535 *** 401: If the user is not authorized.
Silvia Macovei 9.1 536
537 \\
538
539 * **HTTP Method:** PUT
540 ** **Accepted media types:**
541 *** **/**
542 ** **Media types:**
Fabio Mancinelli 1.1 543 *** application/xml (AttachmentSummary element)
Silvia Macovei 9.1 544 ** **Description:** Create an attachment identified by {attachmentName} on a given page.
545 ** **Status codes:**
Fabio Mancinelli 1.1 546 *** 201: If the attachment was created.
547 *** 202: If the attachment was updated.
548 *** 401: If the user is not authorized.
Silvia Macovei 9.1 549
550 \\
551
552 * **HTTP Method:** DELETE
553 ** **Media types:**
554 ** **Description:** Delete the attachment identified by {attachmentName} on a given page.
555 ** **Status codes:**
Fabio Mancinelli 1.1 556 *** 204: If the attachment was deleted.
557 *** 401: If the user is not authorized.
558
Vincent Massol 14.2 559 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/attachments[?start~=offset&number~=n] ===
Silvia Macovei 9.1 560
561 * **HTTP Method:** GET
562 ** **Media types:**
Fabio Mancinelli 1.1 563 *** application/xml (Attachments element)
Silvia Macovei 9.1 564 ** **Description:** The list of attachments at a given page {version}.
565 ** **Status codes:**
Fabio Mancinelli 1.1 566 *** 200: If the request was successful.
567 *** 401: If the user is not authorized.
568
Vincent Massol 14.2 569 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/attachments/{attachmentName} ===
Silvia Macovei 9.1 570
571 * **HTTP Method:** GET
572 ** **Media types:**
Fabio Mancinelli 1.1 573 *** The same of the attachment media type.
Silvia Macovei 9.1 574 ** **Description:** The attachment identified by {attachmentName} on a given page {version}.
575 ** **Status codes:**
Fabio Mancinelli 1.1 576 *** 200: If the request was successful.
577 *** 401: If the user is not authorized.
578
Vincent Massol 14.2 579 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName}/history ===
Silvia Macovei 9.1 580
581 * **HTTP Method:** GET
582 ** **Media types:**
Fabio Mancinelli 1.1 583 *** application/xml (??? element)
Silvia Macovei 9.1 584 ** **Description:** The list of available version for the {attachmentName}
585 ** **Status codes:**
Fabio Mancinelli 1.1 586 *** 200: If the request was successful.
587 *** 401: If the user is not authorized.
588
Vincent Massol 14.2 589 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName}/history/{version} ===
Silvia Macovei 9.1 590
591 * **HTTP Method:** GET
592 ** **Media types:**
Fabio Mancinelli 1.1 593 *** The same of the attachment media type.
Silvia Macovei 9.1 594 ** **Description:** The {attachmentName} at a given {version}
595 ** **Status codes:**
Fabio Mancinelli 1.1 596 *** 200: If the request was successful.
597 *** 401: If the user is not authorized.
598
Vincent Massol 14.2 599 == Object resources ==
Fabio Mancinelli 1.1 600
Vincent Massol 14.2 601 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects[?start~=offset&number~=n] ===
Silvia Macovei 9.1 602
603 * **HTTP Method:** GET
604 ** **Media types:**
Fabio Mancinelli 1.1 605 *** application/xml (Objects element)
Silvia Macovei 9.1 606 ** **Description:** The list of objects associated to a page.
607 ** **Status codes:**
Fabio Mancinelli 1.1 608 *** 200: If the request was successful.
609 *** 401: If the user is not authorized.
Silvia Macovei 9.1 610
611 \\
612
613 * **HTTP Method:** POST
614 ** **Accepted media types:**
Fabio Mancinelli 1.1 615 *** application/xml (Object element)
616 *** application/x-www-formurlencoded (a set of property#name=value pairs representing properties and a field className)
Silvia Macovei 9.1 617 ** **Media types:**
618 *** application/xml (Object element)
619 ** **Description:** Create a new object.
620 ** **Status codes:**
Fabio Mancinelli 1.1 621 *** 201: If the object was created (The Location header will contain the URI associated to the newly created object).
622 *** 401: If the user is not authorized.
623
Vincent Massol 14.2 624 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}[?start~=offset&number~=n] ===
Silvia Macovei 9.1 625
626 * **HTTP Method:** GET
627 ** **Media types:**
Fabio Mancinelli 1.1 628 *** application/xml (Objects element)
Silvia Macovei 9.1 629 ** **Description:** The list of objects of a given {className} associated to a page.
630 ** **Status codes:**
Fabio Mancinelli 1.1 631 *** 200: If the request was successful.
632 *** 401: If the user is not authorized.
633
Vincent Massol 14.2 634 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber} ===
Silvia Macovei 9.1 635
636 * **HTTP Method:** GET
637 ** **Media types:**
Fabio Mancinelli 1.1 638 *** application/xml (Object element)
Silvia Macovei 9.1 639 ** **Description:** The object of type {className} identified by {objectNumber} associated to the given page.
640 ** **Status codes:**
Fabio Mancinelli 1.1 641 *** 200: If the request was successful.
642 *** 401: If the user is not authorized.
Silvia Macovei 9.1 643
644 \\
645
646 * **HTTP Method:** PUT
647 ** **Accepted media types:**
Fabio Mancinelli 1.1 648 *** application/xml (Object element)
649 *** application/x-www-formurlencoded (a set of property#name=value pairs representing properties)
Silvia Macovei 9.1 650 ** **Media types:**
651 *** application/xml (Object element)
652 ** **Description:** Modify the object properties.
653 ** **Status codes:**
Fabio Mancinelli 1.1 654 *** 202: If the object was updated.
655 *** 401: If the user is not authorized.
Silvia Macovei 9.1 656
657 \\
658
659 * **HTTP Method:** DELETE
660 ** **Media types:**
661 ** **Description:** Delete the object.
662 ** **Status codes:**
Fabio Mancinelli 1.1 663 *** 204: If the object was deleted.
664 *** 401: If the user is not authorized.
665
Vincent Massol 14.2 666 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber}/properties ===
Silvia Macovei 9.1 667
668 * **HTTP Method:** GET
669 ** **Media types:**
Fabio Mancinelli 1.1 670 *** application/xml (Properties element)
Silvia Macovei 9.1 671 ** **Description:** The properties of the object of type {className} identified by {objectNumber} associated to the given page.
672 ** **Status codes:**
Fabio Mancinelli 1.1 673 *** 200: If the request was successful.
674 *** 401: If the user is not authorized.
675
Vincent Massol 14.2 676 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber}/properties/{propertyName} ===
Silvia Macovei 9.1 677
678 * **HTTP Method:** GET
679 ** **Media types:**
Fabio Mancinelli 1.1 680 *** application/xml (Properties element)
Silvia Macovei 9.1 681 ** **Description:** The property {propertyname} of the object of type {className} identified by {objectNumber} associated to the given page.
682 ** **Status codes:**
Fabio Mancinelli 1.1 683 *** 200: If the request was successful.
684 *** 401: If the user is not authorized.
Silvia Macovei 9.1 685
686 \\
687
688 * **HTTP Method:** PUT
689 ** **Accepted media types:**
Fabio Mancinelli 1.1 690 *** application/xml (Property element)
691 *** text/plain
692 *** application/x-www-formurlencoded (a field property#name=value pairs representing a property)
Silvia Macovei 9.1 693 ** **Media types:**
694 *** application/xml (Property element)
695 ** **Description:** Modify the object properties.
696 ** **Status codes:**
Fabio Mancinelli 1.1 697 *** 202: If the object was updated.
698 *** 401: If the user is not authorized.
699
Vincent Massol 14.2 700 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects[?start~=offset&number~=n] ===
Silvia Macovei 9.1 701
702 * **HTTP Method:** GET
703 ** **Media types:**
Fabio Mancinelli 1.1 704 *** application/xml (Objects element)
Silvia Macovei 9.1 705 ** **Description:** The list of objects associated to a page at a given {version}.
706 ** **Status codes:**
Fabio Mancinelli 1.1 707 *** 200: If the request was successful.
708 *** 401: If the user is not authorized.
709
Vincent Massol 14.2 710 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber} ===
Silvia Macovei 9.1 711
712 * **HTTP Method:** GET
713 ** **Media types:**
Fabio Mancinelli 1.1 714 *** application/xml (Object element)
Silvia Macovei 9.1 715 ** **Description:** The object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
716 ** **Status codes:**
Fabio Mancinelli 1.1 717 *** 200: If the request was successful.
718 *** 401: If the user is not authorized.
719
Vincent Massol 14.2 720 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties ===
Silvia Macovei 9.1 721
722 * **HTTP Method:** GET
723 ** **Media types:**
Fabio Mancinelli 1.1 724 *** application/xml (Properties element)
Silvia Macovei 9.1 725 ** **Description:** The properties of the object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
726 ** **Status codes:**
Fabio Mancinelli 1.1 727 *** 200: If the request was successful.
728 *** 401: If the user is not authorized.
729
Vincent Massol 14.2 730 === /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties/{propertyName} ===
Silvia Macovei 9.1 731
732 * **HTTP Method:** GET
733 ** **Media types:**
Fabio Mancinelli 1.1 734 *** application/xml (Properties element)
Silvia Macovei 9.1 735 ** **Description:** The property {propertyname} of the object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
736 ** **Status codes:**
Fabio Mancinelli 1.1 737 *** 200: If the request was successful.
738 *** 401: If the user is not authorized.
739
Vincent Massol 14.2 740 === /wikis/{wikiName}/class/{className}/objects ===
Silvia Macovei 9.1 741
742 * **HTTP Method:** GET
743 ** **Media types:**
Fabio Mancinelli 1.1 744 *** application/xml (Objects element)
Silvia Macovei 9.1 745 ** **Description:** The list of all the objects of a given {className}.
746 ** **Status codes:**
Fabio Mancinelli 1.1 747 *** 200: If the request was successful.
748 *** 401: If the user is not authorized.
749
Vincent Massol 14.2 750 == Class resources ==
Fabio Mancinelli 1.1 751
Vincent Massol 14.2 752 === /wikis/{wikiName}/classes[?start~=offset&number~=n] ===
Silvia Macovei 9.1 753
754 * **HTTP Method:** GET
755 ** **Media types:**
Fabio Mancinelli 1.1 756 *** application/xml (Classes element)
Silvia Macovei 9.1 757 ** **Description:** The list of all the classes defined in the wiki {wikiName}
758 ** **Status codes:**
Fabio Mancinelli 1.1 759 *** 200: If the request was successful.
760 *** 401: If the user is not authorized.
761
Vincent Massol 14.2 762 === /wikis/{wikiName}/classes/{className} ===
Silvia Macovei 9.1 763
764 * **HTTP Method:** GET
765 ** **Media types:**
Fabio Mancinelli 1.1 766 *** application/xml (Class element)
Silvia Macovei 9.1 767 ** **Description:** The {className} definition
768 ** **Status codes:**
Fabio Mancinelli 1.1 769 *** 200: If the request was successful.
770 *** 401: If the user is not authorized.
771
Vincent Massol 14.2 772 === /wikis/{wikiName}/classes/{className}/properties ===
Silvia Macovei 9.1 773
774 * **HTTP Method:** GET
775 ** **Media types:**
Fabio Mancinelli 1.1 776 *** application/xml (Properties element)
Silvia Macovei 9.1 777 ** **Description:** The properties of the class {className}.
778 ** **Status codes:**
Fabio Mancinelli 1.1 779 *** 200: If the request was successful.
780 *** 401: If the user is not authorized.
781
Vincent Massol 14.2 782 === /wikis/{wikiName}/classes/{className}/properties/{property} ===
Silvia Macovei 9.1 783
784 * **HTTP Method:** GET
785 ** **Media types:**
Fabio Mancinelli 1.1 786 *** application/xml (Property element)
Silvia Macovei 9.1 787 ** **Description:** The property {property} of the class {className}.
788 ** **Status codes:**
Fabio Mancinelli 1.1 789 *** 200: If the request was successful.
790 *** 401: If the user is not authorized.
791
Vincent Massol 14.2 792 == Other resources ==
Fabio Mancinelli 1.1 793
Ludovic Dubost 21.1 794 === /wikis/{wikiName}/modifications[?start~=offset&number~=n&date~=t] ===
Silvia Macovei 9.1 795
796 * **HTTP Method:** GET
797 ** **Media types:**
Fabio Mancinelli 1.1 798 *** application/xml (Modifications element)
Silvia Macovei 9.1 799 ** **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)
800 ** **Status codes:**
Fabio Mancinelli 1.1 801 *** 200: If the request was successful.
802 *** 401: If the user is not authorized.
Thomas Mortagne 22.1 803
804 = Custom resources =
805
Thomas Mortagne 24.1 806 It's possible to easily add any REST resource by registering a ##org.xwiki.rest.XWikiResource## java component on your wiki (see [[Component guide>>DevGuide.WritingComponents]] for more details).
Thomas Mortagne 22.1 807
Thomas Mortagne 23.1 808 {{code language="java"}}
Thomas Mortagne 22.1 809 package org.xwiki.contrib.rest;
810
811 import javax.ws.rs.DefaultValue;
812 import javax.ws.rs.GET;
813 import javax.ws.rs.Path;
814
815 import org.xwiki.component.annotation.Component;
816 import org.xwiki.rest.XWikiResource;
817
818 @Component("org.xwiki.contrib.rest.HelloWordResource")
819 @Path("/myresources/{myresourcename}")
820 class HelloWorldResource extends XWikiResource {
821 @GET
822 public String get(@PathParam("myresourcename") @DefaultValue("world") String myresourcename)
823 {
824 return "Hello " + myresourcename;
825 }
826 }
Thomas Mortagne 23.1 827 {{/code}}
Thomas Mortagne 22.1 828
829 The name of the component has to be the class FQN.
830
831 You can find more examples on [[https://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-rest/xwiki-rest-server/src/main/java/org/xwiki/rest/resources/]].

Get Connected