Wiki source code of XWiki RESTful API

Version 8.4 by Silvia Macovei on 2009/09/25

Show last authors
1 1 The XWiki RESTful API
2
3 XWiki provides fine-grain access to virtually every element through an API that is based on HTTP semantics, i.e. a RESTful API.
4 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.
5
6 1.1 Dataset
7
8 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.
9
10 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 attachment 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 object might be directly exposed as first class entities, such as *comments* and *tags*. Objects, as attachments, are shared among all page translations.
11
12 1.1 Understanding resources and representations
13
14 "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., a 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])
15
16 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.
17 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]
18
19 Of course the same resource can be represented in many different ways. When it is the case, this will be documented.
20
21 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 <tt>&lt;link&gt;</tt> 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.
22
23 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.
24
25 {image:representation|430}
26
27 1.1.1 Relations
28
29 The available relations that you might find in the XML resource representations are the following:
30
31 {table}
32 Rel | Semantics
33 http://www.xwiki.org/rel/wikis | The representation containing the list of virtual wikis.
34 http://www.xwiki.org/rel/spaces | The representation containing the list of spaces in a wiki.
35 http://www.xwiki.org/rel/pages | The representations containing the list of pages in a space.
36 http://www.xwiki.org/rel/translation| The representation containing a translation of a page.
37 http://www.xwiki.org/rel/page | The representation for a page.
38 http://www.xwiki.org/rel/space | The representation for a space.
39 http://www.xwiki.org/rel/parent | The representation for the page that is parent of the current resource.
40 http://www.xwiki.org/rel/home | The representation for the page that is the home of the current resource.
41 http://www.xwiki.org/rel/attachmentData | The representation of the actual attachment data.
42 http://www.xwiki.org/rel/comments | The representation of the list of comments associated to the current resource.
43 http://www.xwiki.org/rel/attachments | The representation of the list of attachments associated to the current resource.
44 http://www.xwiki.org/rel/objects | The representation of the list of objects associated to the current resource.
45 http://www.xwiki.org/rel/object | The representation for an object.
46 http://www.xwiki.org/rel/classes | The representation of the list of classes associated to the current resource.
47 http://www.xwiki.org/rel/history | The representation of the list of history information associated to the current resource.
48 http://www.xwiki.org/rel/class | The representation for a class.
49 http://www.xwiki.org/rel/property | The representation for a property.
50 http://www.xwiki.org/rel/properties | The representation of the list of properties associated to the current resource.
51 http://www.xwiki.org/rel/modifications | The representation of the list of modifications associated to the current resource.
52 http://www.xwiki.org/rel/children | The representation of the list of children associated to the current resource.
53 http://www.xwiki.org/rel/tags | The representation of the list of tags associated to the current resource.
54 http://www.xwiki.org/rel/tag | The representation of a tag.
55 http://www.xwiki.org/rel/search | The representation for a search resource.
56 {table}
57
58 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).
59
60 1.1.1 The "HATEOAS" Graph
61
62 In order to better understand the relations among resources you might have a look at this {attach:graph|file=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.
63
64 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.
65
66
67
68 1.1 Interacting with the XWiki RESTful API
69
70 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!
71 If you want to write more complex programs you might download an HTTP library for your favorite language (e.g., [http://hc.apache.org/]).
72
73 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.
74
75 If you use this approach (Apache HTTP Client + JAXB) you will find yourself writing some code like this:
76
77 {code}
78 HttpClient httpClient = new HttpClient();
79 JAXBContext context = JAXBContext.newInstance("model.package");
80 unmarshaller = context.createUnmarshaller();
81
82 GetMethod getMethod = new GetMethod("http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome");
83 getMethod.addRequestHeader("Accept", "application/xml");
84 httpClient.executeMethod(getMethod);
85
86 Page page = (Page) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());
87 {code}
88
89 And you will have all the information about the Main.WebHome page in the Page object, without the need of handling XML directly.
90
91 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.
92
93 By using curl, the previous example would have been:
94
95 {code}
96 $ curl http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome
97 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
98 <page xmlns="http://www.xwiki.org">
99 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
100 ...
101 {code}
102
103 1.1.1 Authentication
104
105 The XWiki RESTful API supports two types of authentication:
106
107 * *HTTP BASIC Auth*: You provide your credentials using the Authorization HTTP header
108
109 * *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.
110
111 If you don't provide any credentials the XWiki RESTful API will recognize you as a XWiki.Guest user.
112
113 So if you have, let's say a Main.PrivatePage, and you try to do:
114
115 {code}
116 $ curl -v http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
117 ...
118 < HTTP/1.1 401 Unauthorized
119 ...
120 {code}
121
122 You will get an Unathorized empty response.
123
124 On the contrary, by specifying Admin credentials you gain access to the actual page:
125
126 {code}
127 $ curl -u Admin:admin http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
128 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
129 <page xmlns="http://www.xwiki.org">
130 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
131 ...
132 <content>Only admin can see this</content>
133 </page>
134 {code}
135
136 1.1.1 Sending representations
137
138 Many resources are modifiable, so you can send representations in order to change the state of those resources (e.g., pages).
139 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).
140
141 Resource update is usually done by using the PUT method, while resource creation is done via PUT or POST.
142
143 For example, in order to create a page you might do the following:
144
145 {code}
146 $ 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
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 <version>1.1</version>
152 <majorVersion>1</majorVersion>
153 <minorVersion>1</minorVersion>
154 <created>2009-03-21+01:00</created>
155 <creator>XWiki.Admin</creator>
156 <modified>2009-03-21+01:00</modified>
157 <modifier>XWiki.Admin</modifier>
158 <content>This is a new page</content>
159 </page>
160 {code}
161
162 Where newpage.xml is an XML file containing
163
164 {code}
165 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
166 <page xmlns="http://www.xwiki.org">
167 <title>Hello world</title>
168 <content>This is a new page</content>
169 </page>
170 {code}
171
172 The page has been created and is accessible. Subsequent PUT requests to the page URI will modify its content.
173
174 1.1.1 Overcoming browser limitations
175
176 As said before, it could be useful to send information by using browser's XmlHttpRequest objects. But 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 <tt>method</tt> parameter in the URI query string.
177
178 In the previous example, if you send a POST request to the <tt>http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/NewPage?method=PUT</tt> it will be interpreted as if it were an actual PUT request.
179
180 This overriding mechanism allows the interaction with the XWiki RESTful API by using any kind of browser.
181
182 1.1.1 PUT vs POST
183
184 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.
185
186 To be more clear, 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.
187
188 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.
189
190
191 1.1 XWiki RESTful API Documentation
192
193 In this section you will find the documentation of the whole XWiki RESTful API.
194
195 *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]
196
197 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.
198
199 1.1.1 Root resources
200
201 1.1.1.1 /
202 * *HTTP Method:* GET
203 ** *Media types:*
204 *** application/xml (XWiki element)
205 ** *Description:* Retrieves the entry root description containing information about the server.
206 ** *Status codes:*
207 *** 200: If the request was successful.
208
209 1.1.1.1 /wikis
210 * *HTTP Method:* GET
211 ** *Media types:*
212 *** application/xml (Wikis element)
213 ** *Description:* Retrieves the entry root description containing information about the server.
214 ** *Status codes:*
215 *** 200: If the request was successful.
216
217 1.1.1.1 /wikis/{wikiName}/search?q={keywords}\[\[&scope={name,content,title,objects}...\]&number=n\]
218 * *HTTP Method:* GET
219 ** *Media types:*
220 *** application/xml (SearchResults element)
221 ** *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}
222 ** *Status codes:*
223 *** 200: If the request was successful.
224
225 1.1.1 Space resources
226
227 1.1.1.1 /wikis/{wikiName}/spaces\[?start=offset&number=n\]
228 * *HTTP Method:* GET
229 ** *Media types:*
230 *** application/xml (Spaces element)
231 ** *Description:* Retrieves the list of spaces available in the {wikiName} wiki.
232 ** *Status codes:*
233 *** 200: If the request was successful.
234
235 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/search?q={keywords}\[\[&scope={name,content,title,objects}...\]&number=n\]
236 * *HTTP Method:* GET
237 ** *Media types:*
238 *** application/xml (Search results element)
239 ** *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}
240 ** *Status codes:*
241 *** 200: If the request was successful.
242 *** 401: If the user is not authorized.
243
244 1.1.1 Page resources
245
246 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages\[?start=offset&number=n\]
247 * *HTTP Method:* GET
248 ** *Media types:*
249 *** application/xml (Pages element)
250 ** *Description:* The list of pages in the space {spaceName}
251 ** *Status codes:*
252 *** 200: If the request was successful
253 *** 401: If the user is not authorized.
254
255 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}
256 * *HTTP Method:* GET
257 ** *Media types:*
258 *** application/xml (Page element)
259 ** *Description:*
260 ** *Status codes:*
261 *** 200: If the request was successful.
262 *** 401: If the user is not authorized.
263 <br/>
264 * *HTTP Method:* PUT
265 ** *Accepted Media types:*
266 *** application/xml (Page element)
267 *** text/plain (Only page content)
268 *** application/x-www-form-urlencoded (allowed field names: title, parent, content)
269 ** *Media types:*
270 *** application/xml (Page element)
271 ** *Description:* Create or updates a page.
272 ** *Status codes:*
273 *** 201: If the page was created.
274 *** 202: If the page was updated.
275 *** 304: If the page was not modified.
276 *** 401: If the user is not authorized.
277 <br/>
278 * *HTTP Method:* DELETE
279 ** *Media types:*
280 *** application/xml (Page element)
281 ** *Description:* Delete the page.
282 ** *Status codes:*
283 *** 204: If the request was successful.
284 *** 401: If the user is not authorized.
285
286 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history\[?start=offset&number=n\]
287 * *HTTP Method:* GET
288 ** *Media types:*
289 *** application/xml (History element)
290 ** *Description:* The list of all the versions of the given page.
291 ** *Status codes:*
292 *** 200: If the request was successful.
293 *** 401: If the user is not authorized.
294
295 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}
296 * *HTTP Method:* GET
297 ** *Media types:*
298 *** application/xml (Page element)
299 ** *Description:* The page at version {version}
300 ** *Status codes:*
301 *** 200: If the request was successful.
302 *** 401: If the user is not authorized.
303
304 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations\[?start=offset&number=n\]
305 * *HTTP Method:* GET
306 ** *Media types:*
307 *** application/xml (Translations element)
308 ** *Description:* The list of available translation for the page
309 ** *Status codes:*
310 *** 200: If the request was successful.
311 *** 401: If the user is not authorized.
312
313 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{language}
314 * *HTTP Method:* GET
315 ** *Media types:*
316 *** application/xml (Page element)
317 ** *Description:* The page at in the given {language}.
318 ** *Status codes:*
319 *** 200: If the request was successful.
320 *** 401: If the user is not authorized.
321 <br/>
322 * *HTTP Method:* PUT
323 ** *Accepted Media types:*
324 *** application/xml (Page element)
325 *** text/plain (Only page content)
326 *** application/x-www-form-urlencoded (allowed field names: title, parent, content)
327 ** *Media types:*
328 *** application/xml (Page element)
329 ** *Description:* Create or updates a page translation.
330 ** *Status codes:*
331 *** 201: If the page was created.
332 *** 202: If the page was updated.
333 *** 304: If the page was not modified.
334 *** 401: If the user is not authorized.
335 <br/>
336 * *HTTP Method:* DELETE
337 ** *Media types:*
338 *** application/xml (Page element)
339 ** *Description:* Delete the page translation.
340 ** *Status codes:*
341 *** 204: If the request was successful.
342 *** 401: If the user is not authorized.
343
344 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{language}/history
345 * *HTTP Method:* GET
346 ** *Media types:*
347 *** application/xml (History element)
348 ** *Description:* The list of all the available revisions of the page in a given {language}.
349 ** *Status codes:*
350 *** 200: If the request was successful.
351 *** 401: If the user is not authorized.
352
353 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{lang}/history/{version}
354 * *HTTP Method:* GET
355 ** *Media types:*
356 *** application/xml (Page element)
357 ** *Description:* A page at a given {version} in a given {language}.
358 ** *Status codes:*
359 *** 200: If the request was successful.
360 *** 401: If the user is not authorized.
361
362 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/children
363 * *HTTP Method:* GET
364 ** *Media types:*
365 *** application/xml (Pages element)
366 ** *Description:* The list of the children of a given page.
367 ** *Status codes:*
368 *** 200: If the request was successful.
369 *** 401: If the user is not authorized.
370
371 1.1.1 Tag resources
372
373 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/tags
374 * *HTTP Method:* GET
375 ** *Media types:*
376 *** application/xml (Tags element)
377 ** *Description:* List page tags.
378 ** *Status codes:*
379 *** 200: If the request was successful.
380 *** 401: If the user is not authorized.
381 <br/>
382 * *HTTP Method:* PUT
383 ** *Accepted Media types:*
384 *** application/xml (Tag element)
385 *** text/plain
386 *** application/x-www-form-urlencoded (allowed field names: tag)
387 ** *Media types:*
388 *** application/xml (Tags element)
389 ** *Description:* Add a tag to the page.
390 ** *Status codes:*
391 *** 202: If the request was successful.
392 *** 401: If the user is not authorized.
393
394 1.1.1.1 /wikis/{wikiName}/tags
395 * *HTTP Method:* GET
396 ** *Media types:*
397 *** application/xml (Tags element)
398 ** *Description:* The list of all available tags
399 ** *Status codes:*
400 *** 200: If the request was successful.
401 *** 401: If the user is not authorized.
402
403 1.1.1.1 /wikis/{wikiName}/tags/{tag1}\[,{tag2},{tag3}...\]\[?start=offset&number=n\]
404 * *HTTP Method:* GET
405 ** *Media types:*
406 *** application/xml (Pages element)
407 ** *Description:* The list of pages having the specified tags.
408 ** *Status codes:*
409 *** 200: If the request was successful.
410 *** 401: If the user is not authorized.
411
412 1.1.1 Comments resources
413
414 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/comments\[?start=offset&number=n\]
415 * *HTTP Method:* GET
416 ** *Media types:*
417 *** application/xml (Comments element)
418 ** *Description:* The list of comments on a given page.
419 ** *Status codes:*
420 *** 200: If the request was successful.
421 *** 401: If the user is not authorized.
422 <br/>
423 * *HTTP Method:* POST
424 ** *Accepted Media types:*
425 *** application/xml (Comment element)
426 *** text/plain
427 *** application/x-www-form-urlencoded (allowed field names: text)
428 ** *Media types:*
429 *** application/xml (Comment element)
430 ** *Description:* Create a comment on the given page.
431 ** *Status codes:*
432 *** 201: If the comment was created. (The Location header will contain the URI where the comment has been created.)
433 *** 401: If the user is not authorized.
434
435 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/comments/{commentId}
436 * *HTTP Method:* GET
437 ** *Media types:*
438 *** application/xml (Comment element)
439 ** *Description:* A specific comment on a page
440 ** *Status codes:*
441 *** 200: If the request was successful.
442 *** 401: If the user is not authorized.
443
444 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/comments
445 * *HTTP Method:* GET
446 ** *Media types:*
447 *** application/xml (Comments element)
448 ** *Description:* The list of comments at a specific page {version}.
449 ** *Status codes:*
450 *** 200: If the request was successful.
451 *** 401: If the user is not authorized.
452
453 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/comments/{commentId}
454 * *HTTP Method:* GET
455 ** *Media types:*
456 *** application/xml (Comment element)
457 ** *Description:* A comment at a specific page {version}.
458 ** *Status codes:*
459 *** 200: If the request was successful.
460 *** 401: If the user is not authorized.
461
462 1.1.1 Attachments resources
463
464 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments\[?start=offset&number=n\]
465 * *HTTP Method:* GET
466 ** *Media types:*
467 *** application/xml (Attachments element)
468 ** *Description:* The list of attachments of a given page.
469 ** *Status codes:*
470 *** 200: If the request was successful.
471 *** 401: If the user is not authorized.
472
473 1.1.1.1 /wikis/{wikiName}/wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName}
474 * *HTTP Method:* GET
475 ** *Media types:*
476 *** The same of the attachment media type.
477 ** *Description:* The attachment identified by {attachmentName} on a given page.
478 ** *Status codes:*
479 *** 200: If the request was successful.
480 *** 401: If the user is not authorized.
481 <br/>
482 * *HTTP Method:* PUT
483 ** *Accepted media types:*
484 *** \*/\*
485 ** *Media types:*
486 *** application/xml (AttachmentSummary element)
487 ** *Description:* Create an attachment identified by {attachmentName} on a given page.
488 ** *Status codes:*
489 *** 201: If the attachment was created.
490 *** 202: If the attachment was updated.
491 *** 401: If the user is not authorized.
492 <br/>
493 * *HTTP Method:* DELETE
494 ** *Media types:*
495 ** *Description:* Delete the attachment identified by {attachmentName} on a given page.
496 ** *Status codes:*
497 *** 204: If the attachment was deleted.
498 *** 401: If the user is not authorized.
499
500 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/attachments\[?start=offset&number=n\]
501 * *HTTP Method:* GET
502 ** *Media types:*
503 *** application/xml (Attachments element)
504 ** *Description:* The list of attachments at a given page {version}.
505 ** *Status codes:*
506 *** 200: If the request was successful.
507 *** 401: If the user is not authorized.
508
509 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/attachments/{attachmentName}
510 * *HTTP Method:* GET
511 ** *Media types:*
512 *** The same of the attachment media type.
513 ** *Description:* The attachment identified by {attachmentName} on a given page {version}.
514 ** *Status codes:*
515 *** 200: If the request was successful.
516 *** 401: If the user is not authorized.
517
518 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName}/history
519 * *HTTP Method:* GET
520 ** *Media types:*
521 *** application/xml (??? element)
522 ** *Description:* The list of available version for the {attachmentName}
523 ** *Status codes:*
524 *** 200: If the request was successful.
525 *** 401: If the user is not authorized.
526
527 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName}/history/{version}
528 * *HTTP Method:* GET
529 ** *Media types:*
530 *** The same of the attachment media type.
531 ** *Description:* The {attachmentName} at a given {version}
532 ** *Status codes:*
533 *** 200: If the request was successful.
534 *** 401: If the user is not authorized.
535
536 1.1.1 Object resources
537
538 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects\[?start=offset&number=n\]
539 * *HTTP Method:* GET
540 ** *Media types:*
541 *** application/xml (Objects element)
542 ** *Description:* The list of objects associated to a page.
543 ** *Status codes:*
544 *** 200: If the request was successful.
545 *** 401: If the user is not authorized.
546 <br/>
547 * *HTTP Method:* POST
548 ** *Accepted media types:*
549 *** application/xml (Object element)
550 *** application/x-www-formurlencoded (a set of property#name=value pairs representing properties and a field className)
551 ** *Media types:*
552 *** application/xml (Object element)
553 ** *Description:* Create a new object.
554 ** *Status codes:*
555 *** 201: If the object was created (The Location header will contain the URI associated to the newly created object).
556 *** 401: If the user is not authorized.
557
558 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}\[?start=offset&number=n\]
559 * *HTTP Method:* GET
560 ** *Media types:*
561 *** application/xml (Objects element)
562 ** *Description:* The list of objects of a given {className} associated to a page.
563 ** *Status codes:*
564 *** 200: If the request was successful.
565 *** 401: If the user is not authorized.
566
567 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber}
568 * *HTTP Method:* GET
569 ** *Media types:*
570 *** application/xml (Object element)
571 ** *Description:* The object of type {className} identified by {objectNumber} associated to the given page.
572 ** *Status codes:*
573 *** 200: If the request was successful.
574 *** 401: If the user is not authorized.
575 <br/>
576 * *HTTP Method:* PUT
577 ** *Accepted media types:*
578 *** application/xml (Object element)
579 *** application/x-www-formurlencoded (a set of property#name=value pairs representing properties)
580 ** *Media types:*
581 *** application/xml (Object element)
582 ** *Description:* Modify the object properties.
583 ** *Status codes:*
584 *** 202: If the object was updated.
585 *** 401: If the user is not authorized.
586 <br/>
587 * *HTTP Method:* DELETE
588 ** *Media types:*
589 ** *Description:* Delete the object.
590 ** *Status codes:*
591 *** 204: If the object was deleted.
592 *** 401: If the user is not authorized.
593
594 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber}/properties
595 * *HTTP Method:* GET
596 ** *Media types:*
597 *** application/xml (Properties element)
598 ** *Description:* The properties of the object of type {className} identified by {objectNumber} associated to the given page.
599 ** *Status codes:*
600 *** 200: If the request was successful.
601 *** 401: If the user is not authorized.
602
603 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber}/properties/{propertyName}
604 * *HTTP Method:* GET
605 ** *Media types:*
606 *** application/xml (Properties element)
607 ** *Description:* The property {propertyname} of the object of type {className} identified by {objectNumber} associated to the given page.
608 ** *Status codes:*
609 *** 200: If the request was successful.
610 *** 401: If the user is not authorized.
611 <br/>
612 * *HTTP Method:* PUT
613 ** *Accepted media types:*
614 *** application/xml (Property element)
615 *** text/plain
616 *** application/x-www-formurlencoded (a field property#name=value pairs representing a property)
617 ** *Media types:*
618 *** application/xml (Property element)
619 ** *Description:* Modify the object properties.
620 ** *Status codes:*
621 *** 202: If the object was updated.
622 *** 401: If the user is not authorized.
623
624 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects\[?start=offset&number=n\]
625 * *HTTP Method:* GET
626 ** *Media types:*
627 *** application/xml (Objects element)
628 ** *Description:* The list of objects associated to a page at a given {version}.
629 ** *Status codes:*
630 *** 200: If the request was successful.
631 *** 401: If the user is not authorized.
632
633 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}
634 * *HTTP Method:* GET
635 ** *Media types:*
636 *** application/xml (Object element)
637 ** *Description:* The object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
638 ** *Status codes:*
639 *** 200: If the request was successful.
640 *** 401: If the user is not authorized.
641
642 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties
643 * *HTTP Method:* GET
644 ** *Media types:*
645 *** application/xml (Properties element)
646 ** *Description:* The properties of the object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
647 ** *Status codes:*
648 *** 200: If the request was successful.
649 *** 401: If the user is not authorized.
650
651 1.1.1.1 /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties/{propertyName}
652 * *HTTP Method:* GET
653 ** *Media types:*
654 *** application/xml (Properties element)
655 ** *Description:* The property {propertyname} of the object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
656 ** *Status codes:*
657 *** 200: If the request was successful.
658 *** 401: If the user is not authorized.
659
660 1.1.1.1 /wikis/{wikiName}/class/{className}/objects
661 * *HTTP Method:* GET
662 ** *Media types:*
663 *** application/xml (Objects element)
664 ** *Description:* The list of all the objects of a given {className}.
665 ** *Status codes:*
666 *** 200: If the request was successful.
667 *** 401: If the user is not authorized.
668
669 1.1.1 Class resources
670
671 1.1.1.1 /wikis/{wikiName}/classes\[?start=offset&number=n\]
672 * *HTTP Method:* GET
673 ** *Media types:*
674 *** application/xml (Classes element)
675 ** *Description:* The list of all the classes defined in the wiki {wikiName}
676 ** *Status codes:*
677 *** 200: If the request was successful.
678 *** 401: If the user is not authorized.
679
680 1.1.1.1 /wikis/{wikiName}/classes/{className}
681 * *HTTP Method:* GET
682 ** *Media types:*
683 *** application/xml (Class element)
684 ** *Description:* The {className} definition
685 ** *Status codes:*
686 *** 200: If the request was successful.
687 *** 401: If the user is not authorized.
688
689 1.1.1.1 /wikis/{wikiName}/classes/{className}/properties
690 * *HTTP Method:* GET
691 ** *Media types:*
692 *** application/xml (Properties element)
693 ** *Description:* The properties of the class {className}.
694 ** *Status codes:*
695 *** 200: If the request was successful.
696 *** 401: If the user is not authorized.
697
698 1.1.1.1 /wikis/{wikiName}/classes/{className}/properties/{property}
699 * *HTTP Method:* GET
700 ** *Media types:*
701 *** application/xml (Property element)
702 ** *Description:* The property {property} of the class {className}.
703 ** *Status codes:*
704 *** 200: If the request was successful.
705 *** 401: If the user is not authorized.
706
707 1.1.1 Other resources
708
709 1.1.1.1 /wikis/{wikiName}/modifications\[?start=offset&number=n&timestamp=t\]
710 * *HTTP Method:* GET
711 ** *Media types:*
712 *** application/xml (Modifications element)
713 ** *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)
714 ** *Status codes:*
715 *** 200: If the request was successful.
716 *** 401: If the user is not authorized.

Get Connected