Wiki source code of XWiki RESTful API

Version 9.3 by Silvia Macovei on 2009/10/06

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

Get Connected