Wiki source code of XWiki RESTful API

Version 3.1 by Fabio Mancinelli on 2009/03/21

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

Get Connected