Wiki source code of REST API

Last modified by Michael Hamann on 2025/06/26

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc depth="2"/}}
3 {{/box}}
4
5 XWiki provides fine-grain access to virtually every element through an API that is based on HTTP semantics, i.e., a RESTful API. In this page you will find all the details to take advantage of this API and the instructions to use it at its full potential.
6
7 = Accessing the service =
8
9 By defaut the XWiki RESTful API entrypoint is rooted at the following URI:
10
11 {{code}}
12 https://<host>:<port>/<context>/rest
13 {{/code}}
14
15 Where:
16
17 * ##host## and ##port## are the domain and port where XWiki is installed
18 * ##context## is the Servlet Context under which XWiki is deployed in the Servlet container. By default the value is ##xwiki##, and if XWiki is installed as a "root" web application as in the [[official Docker image>>https://hub.docker.com/_/xwiki/]], the value is empty (and the REST API is then available at {{code language="none"}}https://<host>:<port>/rest{{/code}}).
19
20 All the resource references described in the [[XWiki RESTful API Documentation>>#HXWikiRESTfulAPIDocumentation]] should be intended relative to this URL.
21
22 For example the ##/wikis## resources on a server running on ##localhost## on port ##8080## can be retrieved using the following URL : ##http:~/~/localhost:8080/xwiki/rest/wikis##
23
24 In addition to retrieving content in XML format, you can also retrieve it in JSON format by adding the parameter ##?media=json## in the URL or by setting the ##Accept## header in the request to ##application/json##. For example:
25
26 * ##http:~/~/localhost:8080/xwiki/rest/wikis?media=json##
27 * ##curl -H 'Accept: application/json' https:~/~/www.xwiki.org/xwiki/rest/##
28
29 = Dataset =
30
31 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.
32
33 XWiki has **pages** organized in **spaces**. Each **page** is available in multiple **versions** (its **history**) and **translations**. Translated pages have their own **versions** and **history** which are independent. Each page might have **attachments**. Each attachment has its own **history**. Attachments are shared among all the different translations of a page (i.e., the same set of attachments is the same regardless of the page language). Pages can have one or more **objects**. Objects are instances of a **class** that contains a set of **properties**. Some objects might be directly exposed as first class entities, such as **comments** and **tags**. Objects, as attachments, are shared among all page translations.
34
35 = Understanding resources and representations =
36
37 "An important concept in REST is the existence of resources (sources of specific information), each of which is referenced with a global identifier (e.g., an URI in HTTP). In order to manipulate these resources, components of the network (user agents and origin servers) communicate via a standardized interface (e.g., HTTP) and exchange representations of these resources (the actual documents conveying the information)." ([[Wikipedia>>http://en.wikipedia.org/wiki/Representational_State_Transfer#Central_principle]])
38
39 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>>https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-model/src/main/resources/xwiki.rest.model.xsd]].
40
41 Of course the same resource can be represented in many different ways. This is yet to be documented.
42
43 Another important aspect of representations is that they contain useful information for linking related resources. This is a realization of the //Hypermedia As The Engine Of The Application State (HATEOAS)// principle. In XML representations this information is conveyed through the ##<link>## tag. This tag has two important parameters: **rel** and **href**. **rel** specifies the "semantics" of the link, while **href** is the URI of the linked resource.
44
45 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.
46
47 [[image:representation||height="430"]]
48
49 == Relations ==
50
51 The available relations that you might find in the XML resource representations are the following:
52
53 |=Rel|=Semantics
54 |{{{http://www.xwiki.org/rel/wikis}}}|The representation containing the list of virtual wikis.
55 |{{{http://www.xwiki.org/rel/spaces}}}|The representation containing the list of spaces in a wiki.
56 |{{{http://www.xwiki.org/rel/pages}}}|The representation containing the list of pages in a space.
57 |{{{http://www.xwiki.org/rel/translation}}}|The representation containing a translation of a page.
58 |{{{http://www.xwiki.org/rel/page}}}|The representation for a page.
59 |{{{http://www.xwiki.org/rel/space}}}|The representation for a space.
60 |{{{http://www.xwiki.org/rel/parent}}}|The representation for the page that is parent of the current resource.
61 |{{{http://www.xwiki.org/rel/home}}}|The representation for the page that is the home of the current resource.
62 |{{{http://www.xwiki.org/rel/attachmentData}}}|The representation of the actual attachment data.
63 |{{{http://www.xwiki.org/rel/comments}}}|The representation of the list of comments associated to the current resource.
64 |{{{http://www.xwiki.org/rel/attachments}}}|The representation of the list of attachments associated to the current resource.
65 |{{{http://www.xwiki.org/rel/objects}}}|The representation of the list of objects associated to the current resource.
66 |{{{http://www.xwiki.org/rel/object}}}|The representation for an object.
67 |{{{http://www.xwiki.org/rel/classes}}}|The representation of the list of classes associated to the current resource.
68 |{{{http://www.xwiki.org/rel/history}}}|The representation of the list of history information associated to the current resource.
69 |{{{http://www.xwiki.org/rel/class}}}|The representation for a class.
70 |{{{http://www.xwiki.org/rel/property}}}|The representation for a property.
71 |{{{http://www.xwiki.org/rel/propertyValues}}}|The representation for the list of property values.
72 |{{{http://www.xwiki.org/rel/properties}}}|The representation of the list of properties associated to the current resource.
73 |{{{http://www.xwiki.org/rel/modifications}}}|The representation of the list of modifications associated to the current resource.
74 |{{{http://www.xwiki.org/rel/children}}}|The representation of the list of children associated to the current resource.
75 |{{{http://www.xwiki.org/rel/tags}}}|The representation of the list of tags associated to the current resource.
76 |{{{http://www.xwiki.org/rel/tag}}}|The representation of a tag.
77 |{{{http://www.xwiki.org/rel/search}}}|The representation for a search resource.
78 |{{{http://www.xwiki.org/rel/syntaxes}}}|The representation for a syntax resource.
79
80 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).
81
82 == The "HATEOAS" Graph ==
83
84 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://code.google.com/p/uri-templates/]] representing classes of resources. Edges are the possible links that you might find in a representation of a given resource, and their associated relations.
85
86 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.
87
88 = Interacting with the XWiki RESTful API =
89
90 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!
91 If you want to write more complex programs you might download an HTTP library for your favorite language (e.g., [[http://hc.apache.org/]]), see [[this post>>xwiki:Blog.Use the Apache HTTP library to interact with the XWiki RESTful API]] by [[Mohamed Boussaa>>xwiki:XWiki.mouhb]].
92
93 Java users might take advantage of the [[JAXB>>http://jaxb.java.net/]] framework and its [[XJC binding compiler>>http://jaxb.java.net/2.2.4/docs/xjc.html]] in order to generate domain object models directly from the [[XML Schema Definition>>https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-model/src/main/resources/xwiki.rest.model.xsd]], and use them for serializing and de-serializing XML representations.
94
95 If you use this approach (Apache HTTP Client + JAXB) you will find yourself writing some code like this:
96
97 {{code language="java"}}
98 import javax.xml.bind.JAXBContext;
99 import javax.xml.bind.Unmarshaller;
100
101 import org.apache.commons.httpclient.HttpClient;
102 import org.apache.commons.httpclient.methods.GetMethod;
103 import org.xwiki.rest.model.jaxb.Page;
104
105 ...
106 HttpClient httpClient = new HttpClient();
107 JAXBContext context = JAXBContext.newInstance("org.xwiki.rest.model.jaxb");
108 Unmarshaller unmarshaller = context.createUnmarshaller();
109
110 GetMethod getMethod = new GetMethod("http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome");
111 getMethod.addRequestHeader("Accept", "application/xml");
112 httpClient.executeMethod(getMethod);
113
114 Page page = (Page) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());
115 {{/code}}
116
117 And you will have all the information about the Main.WebHome page in the Page object, without the need of handling XML directly.
118
119 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.
120
121 By using curl, the previous example would have been:
122
123 {{code language="xml"}}
124 $ curl http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome
125
126 <page xmlns="http://www.xwiki.org">
127 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
128 ...
129 {{/code}}
130
131 == Authentication ==
132
133 The XWiki RESTful API supports several types of authentication:
134
135 * **HTTP BASIC Auth**: You provide your credentials using the Authorization HTTP header
136 * **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.
137 * **Custom authentication methods:** if you have setup a custom authenticator on your wiki (such as [[OIDC>>extensions:Extension.OpenID Connect.WebHome]], or [[Trusted authentication>>extensions:Extension.Trusted authentication framework]] or even your own custom ones), additional authentication methods may be available for the RESTful API, provided by these authenticators.
138
139 If you don't provide any credentials the XWiki RESTful API will recognize you as a XWiki.Guest user.
140
141 So if you have, let's say a Main.PrivatePage, and you try to do:
142
143 {{code language="none"}}
144 $ curl -v http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
145 ...
146 < HTTP/1.1 401 Unauthorized
147 ...
148 {{/code}}
149
150 You will get an Unauthorized empty response.
151
152 On the contrary, by specifying Admin credentials you gain access to the actual page:
153
154 {{code language="xml"}}
155 $ curl -u Admin:admin http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
156
157 <page xmlns="http://www.xwiki.org">
158 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
159 ...
160 <content>Only admin can see this</content>
161 </page>
162 {{/code}}
163
164 === CSRF Token ===
165
166 {{version since="14.10.8,15.2"}}
167 When using a ##POST## request with a content type of ##text/plain##, ##multipart/form-data## or ##application/www-form-urlencoded##, a form token needs to be sent in the header ##XWiki-Form-Token## to prevent cross-site request forgery. The form token is provided in every response in the same header so a ##GET## request to any supported endpoint can be used to obtain a form token. If the form token is missing or wrong, a response with status code 403 and "Invalid or missing form token." as body of type ##text/plain## is sent. As of XWiki 15.2, the form token will stay the same for a user until the server is restarted. As server restarts might happen at any time, API clients should handle this response code and re-try the request with the form token that is returned in the error response. When the form token is provided in a request where it isn't necessary, it won't be checked for validity so it doesn't hurt to just send the token in every request.
168
169 It cannot be excluded that in the future, the form token might depend on the user's session. Therefore, for compatibility with future versions, it might be a good idea to store and send cookies.
170
171 When using the REST API in JavaScript code from within XWiki's UI, the form token is automatically sent in every same-origin request initiated through ##fetch## or ##XMLHttpRequest##. Therefore, no special steps should be needed for REST requests to the current XWiki instance.
172 {{/version}}
173
174 == Sending representations ==
175
176 Many resources are modifiable, so you can send representations in order to change the state of those resources (e.g., pages).
177 All modifiable resources accept XML representations that conform to the [[XML Schema Definition>>https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-model/src/main/resources/xwiki.rest.model.xsd]]. However, some other representations might be accepted as well (see the following sections).
178
179 Resource update is usually done by using the PUT method, while resource creation is done via PUT or POST.
180
181 For example, in order to create a page you might do the following:
182
183 {{code language="xml"}}
184 $ curl -u Admin:admin -X PUT --data-binary "@newpage.xml" -H "Content-Type: application/xml" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/NewPage
185
186 <page xmlns="http://www.xwiki.org">
187 <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
188 ...
189 <version>1.1</version>
190 <majorVersion>1</majorVersion>
191 <minorVersion>1</minorVersion>
192 <created>2009-03-21+01:00</created>
193 <creator>XWiki.Admin</creator>
194 <modified>2009-03-21+01:00</modified>
195 <modifier>XWiki.Admin</modifier>
196 <content>This is a new page</content>
197 </page>
198 {{/code}}
199
200 Where newpage.xml is an XML file containing
201
202 {{code language="xml"}}
203
204 <page xmlns="http://www.xwiki.org">
205 <title>Hello world</title>
206 <syntax>xwiki/2.0</syntax>
207 <content>This is a new page</content>
208 </page>
209 {{/code}}
210
211 The page has been created and is accessible. Subsequent PUT requests to the page URI will modify its content.
212
213 You can specify a subset of the three elements {{{title}}}, {{{syntax}}}, and {{{content}}} in the XML when updating/creating a page.
214 For example, if you just want to change the title, it is sufficient to specify only the {{{title}}} element. The current content and the syntax of the page will be left unchanged.
215
216 == Overcoming browser limitations ==
217
218 As said before, it could be useful to send information by using browser's XmlHttpRequest objects. However, currently many browsers only support GET and POST methods, so it is impossible to send, for example, PUT requests. In order to overcome this limitation you can override the HTTP Method by specifying a ##method## parameter in the URI query string.
219
220 In the previous example, if you send a POST request to the ##http:~/~/localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/NewPage?method=PUT## it will be interpreted as if it were an actual PUT request.
221
222 This overriding mechanism allows the interaction with the XWiki RESTful API by using any kind of browser.
223
224 == PUT vs POST ==
225
226 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.
227
228 To be clearer, when a client wants to create a page it knows **where** that page should go, so it is able to communicate the server the target URI. PUT is used.
229
230 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.
231
232 == Headers ==
233
234 The response of the REST requests always contain some custom headers that might be useful:
235
236 * ##xwiki-version##: contains the representation of the version of XWiki defined in ##version.properties## (e.g. 14.4.6)
237 * ##xwiki-user##: contains the reference of the user used to perform the request (e.g. xwiki:XWiki.JohnDoe). If the request is performed as guest, the header won't be present.
238
239 = XWiki RESTful API Documentation =
240
241 In this section you will find the documentation of the whole XWiki RESTful API.
242
243 **application/xml** representations refers to the [[XML Schema Definition>>https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-model/src/main/resources/xwiki.rest.model.xsd]].
244
245 Resource URIs are specified using [[URI templates>>http://code.google.com/p/uri-templates/]]. Bracketed elements are formal parameters and should be instantiated to actual values in order to retrieve the associated resource.
246
247 == Root resources ==
248
249 By defaut all the resources of the RESTful API are rooted at the following URI: ##http:~/~/server:port/xwiki/rest/## (depending on where your XWiki is running)
250
251 === / ===
252
253 * **HTTP Method:** GET
254 ** **Media types:**
255 *** application/xml (XWiki element)
256 ** **Description:** Retrieves the entry root description containing information about the server (currently returns the XWiki product Version).
257 ** **Status codes:**
258 *** 200: If the request was successful.
259
260 === /syntaxes ===
261
262 * **HTTP Method:** GET
263 ** **Media types:**
264 *** application/xml (Syntaxes element)
265 ** **Description:** The list of syntaxes supported by the XWiki instance.
266 ** **Status codes:**
267 *** 200: If the request was successful.
268
269 === /wikis ===
270
271 * **HTTP Method:** GET
272 ** **Media types:**
273 *** application/xml (Wikis element)
274 ** **Description:** The list of wikis available on the XWiki instance. Unless the wiki is configured to be a wiki farm, this list is usually made of a single element 'xwiki'.
275 ** **Status codes:**
276 *** 200: If the request was successful.
277
278 === /wikis/query?q~={query}&wikis~=wikiList[&distinct~={true,false}][&order~={asc,desc}][&start~=n][&number~=n][&prettyNames~={true,false}] ===
279
280 * **HTTP Method:** GET
281 ** **Media types:**
282 *** application/xml (SearchResults element)
283 ** **Description:** Search resources (pages and attachments):
284 *** [since 6.4] using a SOLR query (handled by the [[SOLR Query module>>extensions:Extension.Solr Search Query API]]) on the wikis that are specified as a comma separated list in the //wikis// parameter.
285 *** [before 6.4] using a Lucene query (handled by the [[Lucene Plugin>>extensions:Extension.Lucene Plugin]]) on the wikis that are specified as a comma separated list in the //wikis// parameter.
286 ** **Status codes:**
287 *** 200: If the request was successful.
288
289 === /wikis/{wikiName} ===
290
291 * **HTTP Method:** GET
292 ** **Media types:**
293 *** application/xml (Wiki element)
294 ** **Description:** information about the wiki
295 ** **Status codes:**
296 *** 200: If the request was successful.
297
298 * **HTTP Method:** POST
299 ** **Accepted Media types:**
300 *** octet/stream (A XAR file)
301 ** **Media types:**
302 *** application/xml (Wiki element)
303 ** **Query parameters**
304 *** backup={true/false} - import XAR as a backup XAR
305 *** history={RESET/REPLACE/ADD} - history importing
306 ** **Description:** import a XAR in a wiki.
307 ** **Status codes:**
308 *** 200: If the request was successful.
309
310 === /wikis/{wikiName}/children?[offset~=0][&limit~=-1][&search~=] ===
311
312 {{version since="16.4.0RC1"}}
313 * **HTTP Method:** GET
314 ** **Media types:**
315 *** application/xml (Pages element)
316 ** **Query parameters**
317 *** offset={integer} the index of the first child page to return, defaults to 0
318 *** limit={integer} the maximum number of child pages to return, defaults to -1 which means no limit
319 *** search={string} a search string to filter the child pages by name or title, defaults to empty string which means no filtering
320 ** **Description:** the top level pages in the specified wiki
321 ** **Status codes:**
322 *** 200: If the request was successful.
323 {{/version}}
324
325 === /wikis/{wikiName}/search?q~={keywords}~[~[&scope~={name,content,title,objects}...]&start~=n][&number~=n][&orderField~=field&order~={asc,desc}][distinct~={true,false}][&prettyNames~={true,false}] ===
326
327 * **HTTP Method:** GET
328 ** **Media types:**
329 *** application/xml (SearchResults element)
330 ** **Description:** Returns 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} and are obtained via a HQL query. The specified keywords are converted to uppercase and used in a HQL LIKE clause (e.g if the scope is ##CONTENT## then the document's content is matched to the specified keywords).{{version since="17.5.0"}}The search for pages by title, name and content is based on Solr by default, the query backend can be changed in the [[configuration>>#HConfiguration]]. When the query is empty and no order field is specified, the last modified pages are returned. Otherwise, pages are sorted by match score when no order field is specified. Matches are based on the provided keywords, for the last part of the query a wildcard search is performed in the title and name scopes to support matching partially typed words.{{/version}}
331 ** **Status codes:**
332 *** 200: If the request was successful.
333
334 === /wikis/{wikiName}/query?q~={query}&type~={hql,xwql,lucene,solr}[&distinct~={true,false}]~~[&order~={asc,desc}][&start~=n][&number~=n][&prettyNames~={true,false}][&className~=className] ===
335
336 * **HTTP Method:** GET
337 ** **Media types:**
338 *** application/xml (SearchResults element)
339 ** **Description:** Allow to execute HQL, XWQL, Lucene or SOLR queries on the given {wikiName}. The //q// parameter contains the corresponding query. See [[HQL Query Examples in Velocity>>Documentation.DevGuide.Scripting.velocityHqlExamples]], [[XWiki Query Language Specification>>dev:Design.XWiki Query Language Specification]], [[Lucene Plugin>>extensions:Extension.Lucene Plugin]] and [[SOLR query API>>extensions:Extension.Solr Search Query API]] examples of the queries that can be specified in this parameter. If type is //hql// or //xwql// and //className// is specified, the result will also contain the data for the first object of the corresponding class.
340 ** **Status codes:**
341 *** 200: If the request was successful.
342
343 === /wikimanager (This resource is only available when using the [[multi-wiki>>extensions:Extension.Wiki Application]] feature) ===
344
345 * **HTTP Method:** POST
346 ** **Accepted Media types:**
347 *** application/xml (Wiki element)
348 ** **Media types:**
349 *** application/xml (Wiki element)
350 ** **Query parameters**
351 *** template - the wiki template to be used for initializing the wiki.
352 *** history={RESET/REPLACE/ADD} - history importing
353 ** **Description:** create a new wiki.
354 ** **Status codes:**
355 *** 200: If the request was successful.
356
357 == Space resources ==
358
359 === /wikis/{wikiName}/spaces[?start~=offset&number~=n] ===
360
361 * **HTTP Method:** GET
362 ** **Media types:**
363 *** application/xml (Spaces element)
364 ** **Description:** Retrieves the list of spaces available in the {wikiName} wiki.
365 ** **Status codes:**
366 *** 200: If the request was successful.
367
368 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/search?q~={keywords}~[~[&scope~={name,content,title,objects}...]&number~=n] ===
369
370 * **HTTP Method:** GET
371 ** **Media types:**
372 *** application/xml (Search results element)
373 ** **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}
374 ** **Status codes:**
375 *** 200: If the request was successful.
376 *** 401: If the user is not authorized.
377
378 == Page resources ==
379
380 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages[?start~=offset&number~=n] ===
381
382 * **HTTP Method:** GET
383 ** **Media types:**
384 *** application/xml (Pages element)
385 ** **Description:** The list of pages in the space {spaceName}
386 ** **Status codes:**
387 *** 200: If the request was successful.
388 *** 401: If the user is not authorized.
389
390 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}[?prettyNames~={true,false}&objects~={true,false}&class~={true,false}&attachments~={true,false}&minorRevision~={true,false}] ===
391
392 * **HTTP Method:** GET
393 ** **Media types:**
394 *** application/xml (Page element)
395 ** **Query parameters**
396 *** ##prettyNames##: also return the pretty name for various document information (like the author display name, etc). Disabled by default.
397 *** ##objects##: //[since 7.3M1]// also return the objects. Disabled by default.
398 *** ##class##: //[since 7.3M1]// also return the class. Disabled by default.
399 *** ##attachments##: //[since 7.3M1]// also return the attachments metadatas. Disabled by default.
400 ** **Description:**
401 ** **Status codes:**
402 *** 200: If the request was successful.
403 *** 401: If the user is not authorized.
404
405 * **HTTP Method:** PUT
406 ** **Accepted Media types:**
407 *** application/xml (Page element)
408 *** text/plain (Only page content)
409 *** application/x-www-form-urlencoded (allowed field names: title, parent, hidden //[since 7.3]//, content)
410 ** **Media types:**
411 *** application/xml (Page element)
412 ** **Query parameters**
413 *** ##minorRevision## ({{info}}Since 9.11.4 & 10.2RC1{{/info}}): Create a minor revision for the page. Disabled by default.
414 ** **Description:** Create or updates a page.
415 ** **Status codes:**
416 *** 201: If the page was created.
417 *** 202: If the page was updated.
418 *** 304: If the page was not modified.
419 *** 401: If the user is not authorized.
420
421 * **HTTP Method:** DELETE
422 ** **Media types:**
423 *** application/xml (Page element)
424 ** **Description:** Delete the page.
425 ** **Status codes:**
426 *** 204: If the request was successful.
427 *** 401: If the user is not authorized.
428
429 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history[?start~=offset&number~=n] ===
430
431 * **HTTP Method:** GET
432 ** **Media types:**
433 *** application/xml (History element)
434 ** **Description:** The list of all the versions of the given page.
435 ** **Status codes:**
436 *** 200: If the request was successful.
437 *** 401: If the user is not authorized.
438
439 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version} ===
440
441 * **HTTP Method:** GET
442 ** **Media types:**
443 *** application/xml (Page element)
444 ** **Description:** The page at version {version}
445 ** **Status codes:**
446 *** 200: If the request was successful.
447 *** 401: If the user is not authorized.
448
449 ==== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations[?start~=offset&number~=n] ====
450
451 * **HTTP Method:** GET
452 ** **Media types:**
453 *** application/xml (Translations element)
454 ** **Description:** The list of available translation for the page
455 ** **Status codes:**
456 *** 200: If the request was successful.
457 *** 401: If the user is not authorized.
458
459 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations/{language}[?minorRevision~={true,false}] ===
460
461 * **HTTP Method:** GET
462 ** **Media types:**
463 *** application/xml (Page element)
464 ** **Description:** The page at in the given {language}.
465 ** **Status codes:**
466 *** 200: If the request was successful.
467 *** 401: If the user is not authorized.
468
469 * **HTTP Method:** PUT
470 ** **Accepted Media types:**
471 *** application/xml (Page element)
472 *** text/plain (Only page content)
473 *** application/x-www-form-urlencoded (allowed field names: title, parent, content)
474 ** **Media types:**
475 *** application/xml (Page element)
476 ** **Query parameters**
477 *** ##minorRevision## ({{info}}Since 9.11.4 & 10.2RC1{{/info}}): Create a minor revision for the page. Disabled by default.
478 ** **Description:** Create or updates a page translation.
479 ** **Status codes:**
480 *** 201: If the page was created.
481 *** 202: If the page was updated.
482 *** 304: If the page was not modified.
483 *** 401: If the user is not authorized.
484
485 * **HTTP Method:** DELETE
486 ** **Media types:**
487 *** application/xml (Page element)
488 ** **Description:** Delete the page translation.
489 ** **Status codes:**
490 *** 204: If the request was successful.
491 *** 401: If the user is not authorized.
492
493 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations/{language}/history ===
494
495 * **HTTP Method:** GET
496 ** **Media types:**
497 *** application/xml (History element)
498 ** **Description:** The list of all the available revisions of the page in a given {language}.
499 ** **Status codes:**
500 *** 200: If the request was successful.
501 *** 401: If the user is not authorized.
502
503 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations/{lang}/history/{version} ===
504
505 * **HTTP Method:** GET
506 ** **Media types:**
507 *** application/xml (Page element)
508 ** **Description:** A page at a given {version} in a given {language}.
509 ** **Status codes:**
510 *** 200: If the request was successful.
511 *** 401: If the user is not authorized.
512
513 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/children?[start~=0][&number~=-1][&prettyNames~={false,true}][&hierarchy~={parentchild,nestedpages}][&search~=] ===
514
515 * **HTTP Method:** GET
516 ** **Media types:**
517 *** application/xml (Pages element)
518 ** **Query parameters**
519 *** start={integer} the index of the first child page to return, defaults to 0
520 *** number={integer} the maximum number of child pages to return, defaults to -1 which means no limit
521 *** prettyNames={boolean} whether to include rendered page titles in the response (can slow down the response), defaults to false
522 *** {{version since="16.4.0RC1"}}hierarchy={parentchild,nestedpages} the type of hierarchy to use when searching for child pages; for backwards compatibility, the default hierarchy used is "parentchild"; use "nestedpages" hierarchy if you want results that match the current XWiki UI{{/version}}
523 *** {{version since="16.4.0RC1"}}search={string} a search string to filter the child pages by name or title, defaults to empty string which means no filtering{{/version}}
524 ** **Description:** The list of the children of a given page.
525 ** **Status codes:**
526 *** 200: If the request was successful.
527 *** 401: If the user is not authorized.
528
529 === /wikis/{wikiName}/pages[?name~=paneName&space~=spaceName&author~=authorName] ===
530
531 * **HTTP Method:** GET
532 ** **Media types:**
533 *** application/xml (Pages element)
534 ** **Description:** The list of pages in the wiki {wikiName}. Filters can be set for the name, space and/or author to include only pages that match the given filters. This resource can be used to search for pages in a wiki.
535 ** **Status codes:**
536 *** 200: If the request was successful.
537 *** 401: If the user is not authorized.
538
539 == Tag resources ==
540
541 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/tags[?minorRevision~={true,false}] ===
542
543 * **HTTP Method:** GET
544 ** **Media types:**
545 *** application/xml (Tags element)
546 ** **Description:** List page tags.
547 ** **Status codes:**
548 *** 200: If the request was successful.
549 *** 401: If the user is not authorized.
550
551 * **HTTP Method:** PUT
552 ** **Accepted Media types:**
553 *** application/xml (Tag element)
554 *** text/plain
555 *** application/x-www-form-urlencoded (allowed field names: tag)
556 ** **Media types:**
557 *** application/xml (Tags element)
558 ** **Query parameters**
559 *** ##minorRevision## ({{info}}Since 9.11.4 & 10.2RC1{{/info}}): Create a minor revision for the page. Disabled by default.
560 ** **Description:** Add a tag to the page.
561 ** **Status codes:**
562 *** 202: If the request was successful.
563 *** 401: If the user is not authorized.
564
565 === /wikis/{wikiName}/tags ===
566
567 * **HTTP Method:** GET
568 ** **Media types:**
569 *** application/xml (Tags element)
570 ** **Description:** The list of all available tags
571 ** **Status codes:**
572 *** 200: If the request was successful.
573 *** 401: If the user is not authorized.
574
575 === /wikis/{wikiName}/tags/{tag1}[,{tag2},{tag3}...][?start~=offset&number~=n] ===
576
577 * **HTTP Method:** GET
578 ** **Media types:**
579 *** application/xml (Pages element)
580 ** **Description:** The list of pages having the specified tags.
581 ** **Status codes:**
582 *** 200: If the request was successful.
583 *** 401: If the user is not authorized.
584
585 == Comments resources ==
586
587 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/comments[?start~=offset&number~=n] ===
588
589 * **HTTP Method:** GET
590 ** **Media types:**
591 *** application/xml (Comments element)
592 ** **Description:** The list of comments on a given page.
593 ** **Status codes:**
594 *** 200: If the request was successful.
595 *** 401: If the user is not authorized.
596
597 * **HTTP Method:** POST
598 ** **Accepted Media types:**
599 *** application/xml (Comment element)
600 *** text/plain
601 *** application/x-www-form-urlencoded - allowed field names: ##text##, ##replyTo## (object number of the replied comment, since XE 2.3)
602 ** **Media types:**
603 *** application/xml (Comment element)
604 ** **Description:** Create a comment on the given page.
605 ** **Status codes:**
606 *** 201: If the comment was created. (The Location header will contain the URI where the comment has been created.)
607 *** 401: If the user is not authorized.
608
609 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/comments/{commentId} ===
610
611 * **HTTP Method:** GET
612 ** **Media types:**
613 *** application/xml (Comment element)
614 ** **Description:** A specific comment on a page
615 ** **Status codes:**
616 *** 200: If the request was successful.
617 *** 401: If the user is not authorized.
618
619 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/comments ===
620
621 * **HTTP Method:** GET
622 ** **Media types:**
623 *** application/xml (Comments element)
624 ** **Description:** The list of comments at a specific page {version}.
625 ** **Status codes:**
626 *** 200: If the request was successful.
627 *** 401: If the user is not authorized.
628
629 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/comments/{commentId} ===
630
631 * **HTTP Method:** GET
632 ** **Media types:**
633 *** application/xml (Comment element)
634 ** **Description:** A comment at a specific page {version}.
635 ** **Status codes:**
636 *** 200: If the request was successful.
637 *** 401: If the user is not authorized.
638
639 == Attachments resources ==
640
641 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments[?start~=offset&number~=n] ===
642
643 * **HTTP Method:** GET
644 ** **Media types:**
645 *** application/xml (Attachments element)
646 ** **Description:** The list of attachments of a given page.
647 ** **Status codes:**
648 *** 200: If the request was successful.
649 *** 401: If the user is not authorized.
650
651 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments/{attachmentName} ===
652
653 * **HTTP Method:** GET
654 ** **Media types:**
655 *** The same of the attachment media type.
656 ** **Description:** The attachment identified by {attachmentName} on a given page.
657 ** **Status codes:**
658 *** 200: If the request was successful.
659 *** 401: If the user is not authorized.
660
661 * **HTTP Method:** PUT
662 ** **Accepted media types:**
663 *** **/**
664 ** **Media types:**
665 *** application/xml (AttachmentSummary element)
666 ** **Description:** Create an attachment identified by {attachmentName} on a given page.
667 ** **Status codes:**
668 *** 201: If the attachment was created.
669 *** 202: If the attachment was updated.
670 *** 401: If the user is not authorized.
671
672 * **HTTP Method:** DELETE
673 ** **Media types:**
674 ** **Description:** Delete the attachment identified by {attachmentName} on a given page.
675 ** **Status codes:**
676 *** 204: If the attachment was deleted.
677 *** 401: If the user is not authorized.
678
679 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/attachments[?start~=offset&number~=n] ===
680
681 * **HTTP Method:** GET
682 ** **Media types:**
683 *** application/xml (Attachments element)
684 ** **Description:** The list of attachments at a given page {version}.
685 ** **Status codes:**
686 *** 200: If the request was successful.
687 *** 401: If the user is not authorized.
688
689 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/attachments/{attachmentName} ===
690
691 * **HTTP Method:** GET
692 ** **Media types:**
693 *** The same of the attachment media type.
694 ** **Description:** The attachment identified by {attachmentName} on a given page {version}.
695 ** **Status codes:**
696 *** 200: If the request was successful.
697 *** 401: If the user is not authorized.
698
699 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments/{attachmentName}/history ===
700
701 * **HTTP Method:** GET
702 ** **Media types:**
703 *** application/xml (Attachments element)
704 ** **Description:** The list of available version for the {attachmentName}
705 ** **Status codes:**
706 *** 200: If the request was successful.
707 *** 401: If the user is not authorized.
708
709 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments/{attachmentName}/history/{version} ===
710
711 * **HTTP Method:** GET
712 ** **Media types:**
713 *** The same of the attachment media type.
714 ** **Description:** The {attachmentName} at a given {version}
715 ** **Status codes:**
716 *** 200: If the request was successful.
717 *** 401: If the user is not authorized.
718
719 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/attachments[?name~=attachmentName&page~=pageName&author~=authorName&types~=attachmentTypeList&start~=offset&number~=n] ===
720
721 * **HTTP Method:** GET
722 ** **Media types:**
723 *** application/xml (Attachments element)
724 ** **Description:** The list of attachments of pages located in a given {spaceName}. Filters can be set for the name, page, author and/or types (comma separated list of strings) to include only attachments that match the given filters. This resource can be used to search for attachments in a space.
725 ** **Status codes:**
726 *** 200: If the request was successful.
727 *** 401: If the user is not authorized.
728
729 === /wikis/{wikiName}/attachments[?name~=attachmentName&page~=pageName&space~=spaceName&author~=authorName&types~=attachmentTypeList&start~=offset&number~=n] ===
730
731 * **HTTP Method:** GET
732 ** **Media types:**
733 *** application/xml (Attachments element)
734 ** **Description:** The list of attachments in a given {wikiName}. Filters can be set for the name, page, space, author and/or type (comma separated list of strings) to include only attachments that match the given filters. This resource can be used to search for attachments in a wiki.
735 ** **Status codes:**
736 *** 200: If the request was successful.
737 *** 401: If the user is not authorized.
738
739 == Object resources ==
740
741 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects[?start~=offset&number~=n] ===
742
743 * **HTTP Method:** GET
744 ** **Media types:**
745 *** application/xml (Objects element)
746 ** **Description:** The list of objects associated to a page.
747 ** **Status codes:**
748 *** 200: If the request was successful.
749 *** 401: If the user is not authorized.
750
751 * **HTTP Method:** POST
752 ** **Accepted media types:**
753 *** application/xml (Object element)
754 *** application/x-www-form-urlencoded (a set of property#name=value pairs representing properties and a field className)
755 **** e.g. {{code language="none"}}className=XWiki.XWikiUsers&property#first_name=John&property#last_name=Doe{{/code}}
756 ** **Media types:**
757 *** application/xml (Object element)
758 ** **Description:** Create a new object.
759 ** **Status codes:**
760 *** 201: If the object was created (The Location header will contain the URI associated to the newly created object).
761 *** 401: If the user is not authorized.
762
763 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}[?start~=offset&number~=n] ===
764
765 * **HTTP Method:** GET
766 ** **Media types:**
767 *** application/xml (Objects element)
768 ** **Description:** The list of objects of a given {className} associated to a page.
769 ** **Status codes:**
770 *** 200: If the request was successful.
771 *** 401: If the user is not authorized.
772
773 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}/{objectNumber}[?minorRevision~={true,false}] ===
774
775 * **HTTP Method:** GET
776 ** **Media types:**
777 *** application/xml (Object element)
778 ** **Description:** The object of type {className} identified by {objectNumber} associated to the given page.
779 ** **Status codes:**
780 *** 200: If the request was successful.
781 *** 401: If the user is not authorized.
782
783 * **HTTP Method:** PUT
784 ** **Accepted media types:**
785 *** application/xml (Object element)
786 *** application/x-www-form-urlencoded (a set of property#name=value pairs representing properties)
787 ** **Media types:**
788 *** application/xml (Object element)
789 ** **Query parameters**
790 *** ##minorRevision## ({{info}}Since 9.11.4 & 10.2RC1{{/info}}): Create a minor revision for the page. Disabled by default.
791 ** **Description:** Modify the object properties.
792 ** **Status codes:**
793 *** 202: If the object was updated.
794 *** 401: If the user is not authorized.
795
796 * **HTTP Method:** DELETE
797 ** **Media types:**
798 ** **Description:** Delete the object.
799 ** **Status codes:**
800 *** 204: If the object was deleted.
801 *** 401: If the user is not authorized.
802
803 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}/{objectNumber}/properties ===
804
805 * **HTTP Method:** GET
806 ** **Media types:**
807 *** application/xml (Properties element)
808 ** **Description:** The properties of the object of type {className} identified by {objectNumber} associated to the given page.
809 ** **Status codes:**
810 *** 200: If the request was successful.
811 *** 401: If the user is not authorized.
812
813 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}/{objectNumber}/properties/{propertyName}[?minorRevision~={true,false}] ===
814
815 * **HTTP Method:** GET
816 ** **Media types:**
817 *** application/xml (Properties element)
818 ** **Description:** The property {propertyname} of the object of type {className} identified by {objectNumber} associated to the given page.
819 ** **Status codes:**
820 *** 200: If the request was successful.
821 *** 401: If the user is not authorized.
822
823 * **HTTP Method:** PUT
824 ** **Accepted media types:**
825 *** application/xml (Property element)
826 *** text/plain
827 *** application/x-www-form-urlencoded (a field property#name=value pairs representing a property)
828 ** **Media types:**
829 *** application/xml (Property element)
830 ** **Query parameters**
831 *** ##minorRevision## ({{info}}Since 9.11.4 & 10.2RC1{{/info}}): Create a minor revision for the page. Disabled by default.
832 ** **Description:** Modify the object properties.
833 ** **Status codes:**
834 *** 202: If the object was updated.
835 *** 401: If the user is not authorized.
836
837 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects[?start~=offset&number~=n] ===
838
839 * **HTTP Method:** GET
840 ** **Media types:**
841 *** application/xml (Objects element)
842 ** **Description:** The list of objects associated to a page at a given {version}.
843 ** **Status codes:**
844 *** 200: If the request was successful.
845 *** 401: If the user is not authorized.
846
847 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects/{className}/{objectNumber} ===
848
849 * **HTTP Method:** GET
850 ** **Media types:**
851 *** application/xml (Object element)
852 ** **Description:** The object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
853 ** **Status codes:**
854 *** 200: If the request was successful.
855 *** 401: If the user is not authorized.
856
857 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties ===
858
859 * **HTTP Method:** GET
860 ** **Media types:**
861 *** application/xml (Properties element)
862 ** **Description:** The properties of the object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
863 ** **Status codes:**
864 *** 200: If the request was successful.
865 *** 401: If the user is not authorized.
866
867 === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties/{propertyName} ===
868
869 * **HTTP Method:** GET
870 ** **Media types:**
871 *** application/xml (Properties element)
872 ** **Description:** The property {propertyName} of the object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
873 ** **Status codes:**
874 *** 200: If the request was successful.
875 *** 401: If the user is not authorized.
876
877 === /wikis/{wikiName}/classes/{className}/objects[?start~=offset&number~=n] ===
878
879 * **HTTP Method:** GET
880 ** **Media types:**
881 *** application/xml (Objects element)
882 ** **Description:** The list of all the objects of a given {className}.
883 ** **Status codes:**
884 *** 200: If the request was successful.
885 *** 401: If the user is not authorized.
886
887 == Class resources ==
888
889 === /wikis/{wikiName}/classes[?start~=offset&number~=n] ===
890
891 * **HTTP Method:** GET
892 ** **Media types:**
893 *** application/xml (Classes element)
894 ** **Description:** The list of all the classes defined in the wiki {wikiName}
895 ** **Status codes:**
896 *** 200: If the request was successful.
897 *** 401: If the user is not authorized.
898
899 === /wikis/{wikiName}/classes/{className} ===
900
901 * **HTTP Method:** GET
902 ** **Media types:**
903 *** application/xml (Class element)
904 ** **Description:** The {className} definition
905 ** **Status codes:**
906 *** 200: If the request was successful.
907 *** 401: If the user is not authorized.
908
909 === /wikis/{wikiName}/classes/{className}/properties ===
910
911 * **HTTP Method:** GET
912 ** **Media types:**
913 *** application/xml (Properties element)
914 ** **Description:** The properties of the class {className}.
915 ** **Status codes:**
916 *** 200: If the request was successful.
917 *** 401: If the user is not authorized.
918
919 === /wikis/{wikiName}/classes/{className}/properties/{propertyName} ===
920
921 * **HTTP Method:** GET
922 ** **Media types:**
923 *** application/xml (Property element)
924 ** **Description:** The property {propertyName} of the class {className}.
925 ** **Status codes:**
926 *** 200: If the request was successful.
927 *** 401: If the user is not authorized.
928
929 === /wikis/{wikiName}/classes/{className}/properties/{propertyName}/values {{info}}Since 9.8RC1{{/info}} ===
930
931 Request parameters:
932
933 |=Name|=Description|
934 |limit|Limit the number of values returned. Zero or a negative number means no limit.
935 |fp|Filter parameters, used to filter the returned values. You can pass multiple filter values by repeating the query string parameter. The way in which the property values are filtered depends on the property type.
936
937 * **HTTP Method:** GET
938 ** **Media types:**
939 *** application/xml (Property element)
940 ** **Description:** The list of values for the property {propertyName} of the class {className}. At the moment only Database List properties are supported.
941 ** **Status codes:**
942 *** 200: If the request was successful.
943 *** 401: If the user is not authorized to view the specified property.
944 *** 404: If the specified property doesn't exist.
945
946 == Job resources ==
947
948 A job is identified by an ID (##jobId##) which is a list of strings. In the REST URL, you have to represent the ID with a list of strings separated by ##/##. (eg: ##refactoring/delete/11451##).
949
950 === /jobstatus/{jobId} {{info}}Since 7.2M3{{/info}} ===
951
952 Request parameters:
953
954 |=Name|=Required|=Values|=Default|=Description|=Version
955 |##request##|no|##true~|false##|##false##|Return also the job request|9.1RC1
956 |##progress##|no|##true~|false##|##true##|Return also the job progress|9.1RC1
957 |##log##|no|##true~|false##|##false##|Return also the job log|9.1RC1
958 |##log_fromLevel##|no|##error~|warn~|info~|debug~|trace##| |Indicate the level from which to return logs|9.1RC1
959
960 * **HTTP Method:** GET
961 ** **Media types:**
962 *** application/xml (JobStatus element)
963 ** **Description:** status of a job
964 ** **Status codes:**
965 *** 200: If the request was successful.
966 *** 404: If the job status has not been found
967
968 === /joblog/{jobId} {{info}}Since 7.2M3{{/info}} ===
969
970 Request parameters:
971
972 |=Name|=Required|=Values|=Default|=Description|=Version
973 |##level##|no|##error~|warn~|info~|debug~|trace##| |Indicate the exact level for which to return logs|7.2M3
974 |##fromLevel##|no|##error~|warn~|info~|debug~|trace##| |Indicate the level from which to return logs|7.2M3
975
976 * **HTTP Method:** GET
977 ** **Media types:**
978 *** application/xml (JobLog element)
979 ** **Description:** log of a job
980 ** **Status codes:**
981 *** 200: If the request was successful.
982 *** 404: If the job status has not been found
983
984 === /jobs {{info}}Since 9.1RC1{{/info}} ===
985
986 Request parameters:
987
988 |=Name|=Required|=Values|=Default|=Description|=Version
989 |##jobType##|yes| | |The type of the job to pass to the Job Executor|9.1RC1
990 |##async##|no|##true~|false##|##true##|If false, return the response only when the job is done|9.1RC1
991
992 This API is designed to be a REST clone of the JobExecutor Java API (the only real difference right now being way to deal with asynchronous jobs) documented on http://extensions.xwiki.org/xwiki/bin/view/Extension/Job+Module#HUseanexistingjob so the concepts (job type, job request) are the same and the exact information to put in the job request depends on the job you want to run and are usually documented in the extension this job is coming from (extension module, refactoring, etc.).
993
994 * **HTTP Method:** PUT
995 ** **Input:**
996 *** Media Types: ##application/xml## or ##application/json##
997 *** Input body: ##JobRequest## element
998 ** **Output:**
999 *** Media Types: ##application/xml## or ##application/json##
1000 *** Response body: ##JobStatus## element
1001 ** **Description:** Start a new job synchronously or asynchronously
1002 ** **Status codes:**
1003 *** 200: If the job was successfully executed
1004 *** 401: If the user is not authorized (i.e. doesn't have Programming Rights)
1005 *** 500: Failing jobs with ##async=false## return an error 500 (Since 9.7RC1)
1006
1007 Jobs started through the REST API automatically get their runtime context injected with the following REST HTTP request context properties:
1008
1009 * current wiki
1010 * current user
1011 * request URL and parameters
1012
1013 There is JAXB objects provided to make easy to create a request for Java and other JVM based clients. For other use cases the hard part is generally generating the XML to send as content and you can either:
1014
1015 * ask for the status of an existing job to have an hint of how the XML/JSON should look like (see [[jobstatus section>>#H2Fjobstatus2F7BjobId7D]])
1016 * generate this XML in a script in a wiki page, you can look at the following example to help with that: https://snippets.xwiki.org/xwiki/bin/view/Extension/Generate%20Refactoring%20Job%20REST%20request%20XML/
1017
1018 === Example of Extension Manager installJob ===
1019
1020 Using the attach:installjobrequest.xml file you can use a request like the following one to ask for the installation of an extension (in this example the XWiki OIDC module version 1.28):
1021
1022 {{code language="none"}}
1023 curl -i --user "Admin:admin" -X PUT -H "Content-Type: text/xml" "http://localhost:8080/xwiki/rest/jobs?jobType=install&async=false" --upload-file installjobrequest.xml
1024 {{/code}}
1025
1026 == Localization resources ==
1027
1028 For more details see the [[Localization Module documentation>>extensions:Extension.Localization.WebHome]].
1029
1030 {{version since="13.3RC1"}}
1031 === /wikis/{wikiName}/localization/translations[?locale~=l&prefix~=p[&key~=k]*] ===
1032
1033 * **HTTP Method**: GET
1034 ** **Media Types:** ##application/xml## or ##application/json##
1035 ** **Description: **The list of translations of the requested keys in a given locale
1036 ** **Query Parameters:**
1037 *** **locale:** (optional) the locale of the returned translation, if missing the locale is resolved from the context
1038 *** **prefix:** (optional) a common prefix concatenated to all the provided keys.
1039 *** **key:** (multiple) a list of translation keys
1040 ** **Status Code:**
1041 *** 200: if the request was successful
1042 ** **Response:**
1043 *** a list of translation objects, each containing the translation key (concatenated with the prefix) and the resolved raw sources (the translation values without the parameters resolved).
1044 {{/version}}
1045
1046 == Icon Theme resources ==
1047
1048 For more details see the [[Icon Theme Application>>extensions:Extension.Icon Theme Application.WebHome]].
1049
1050 {{version since="13.3RC1"}}
1051 === /wikis/{wikiName}/iconThemes/icons[?[name~=n]*] ===
1052
1053 * **HTTP Method**: GET
1054 ** **Media Types:** ##application/xml## or ##application/json##
1055 ** **Description: **Provides the metadata of the icons of the current icon theme in a given ##{wikiName}## wiki
1056 ** **Query Parameters:**
1057 *** **name:** (multiple) the name of the requested icons
1058 ** **Status Code:**
1059 *** 200: if the request was successful
1060 ** **Response:**
1061 *** An object with two attributes: ##icon## is a list of the requested icons metadata, and ##missingIcons## an array of names of requested icons that couldn't be found in the current theme.
1062
1063 === /wikis/{wikiName}/iconThemes/{iconTheme}/icons[?[name~=n]*] ===
1064
1065 * **HTTP Method**: GET
1066 ** **Media Types:** ##application/xml## or ##application/json##
1067 ** **Description: **Provides the metadata of the icons of the ##{iconTheme}## icon theme in a given ##{wikiName}## wiki
1068 ** **Query Parameters:**
1069 *** **name:** (multiple) the name of the requested icons
1070 ** **Status Code:**
1071 *** 200: if the request was successful
1072 ** **Response:**
1073 *** An object with two attributes: ##icon## is a list of the requested icons metadata, and ##missingIcons## an array of names of requested icons that couldn't be found in the requested theme.
1074 {{/version}}
1075
1076 == Other resources ==
1077
1078 === /wikis/{wikiName}/modifications[?start~=offset&number~=n&date~=t] ===
1079
1080 * **HTTP Method:** GET
1081 ** **Media types:**
1082 *** application/xml (Modifications element)
1083 ** **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)
1084 ** **Status codes:**
1085 *** 200: If the request was successful.
1086 *** 401: If the user is not authorized.
1087
1088 = Custom resources =
1089
1090 == In Wiki Pages ==
1091
1092 If you can't find an existing REST endpoint for your needs, you can create your own own by creating a wiki page and putting script in it. For example let's imagine you'd like to get a list of all pages under a given space. You could write a page, say ##GetChildren## with the following content:
1093
1094 {{code language="velocity"}}
1095 {{velocity}}
1096 #if ("$!request.space" != '')
1097 #set ($discard = $response.setContentType('text/xml'))
1098
1099 <pages>
1100 #set ($query = $services.query.xwql("select doc.fullName from Document doc where ((doc.space like :spacelike escape '!') or (doc.space = :space)) and language='' order by doc.date desc"))
1101 #set ($spaceReferenceString = $request.space)
1102 #set ($spaceLike = $spaceReferenceString.replaceAll('([%_!])', '!$1').concat('.%'))
1103 #set ($query = $query.bindValue('spacelike', $spaceLike))
1104 #set ($query = $query.bindValue('space', $spaceReferenceString))
1105 #foreach ($item in $query.execute())
1106 <page>$item</page>
1107 #end
1108 </pages>
1109 #end
1110 {{/velocity}}
1111 {{/code}}
1112
1113 The calling it for example with the following URL ##http:~/~/localhost:8080/xwiki/bin/get/GetChildren/?space=Sandbox&xpage=plain&outputSyntax=plain## would give something like:
1114
1115 {{code language="none"}}
1116 <pages>
1117 <page>Sandbox.Test.WebHome</page>
1118 <page>Sandbox.TestPage2</page>
1119 <page>Sandbox.ApplicationsPanelEntry</page>
1120 <page>Sandbox.TestPage3</page>
1121 <page>Sandbox.TestPage1</page>
1122 <page>Sandbox.WebPreferences</page>
1123 <page>Sandbox.WebHome</page>
1124 </pages>
1125 {{/code}}
1126
1127 == In Java ==
1128
1129 It's possible to easily add any REST resource by registering a ##org.xwiki.rest.XWikiResource## java component on your wiki (see [[Component guide>>Documentation.DevGuide.Tutorials.WritingComponents]] for more details).
1130
1131 {{code language="java"}}
1132 package org.xwiki.contrib.rest;
1133
1134 import javax.ws.rs.DefaultValue;
1135 import javax.ws.rs.GET;
1136 import javax.ws.rs.Path;
1137
1138 import org.xwiki.component.annotation.Component;
1139 import org.xwiki.rest.XWikiResource;
1140
1141 @Component("org.xwiki.contrib.rest.HelloWorldResource")
1142 @Path("/myresources/{myresourcename}")
1143 public class HelloWorldResource extends XWikiResource {
1144 @GET
1145 public String get(@PathParam("myresourcename") @DefaultValue("world") String myresourcename)
1146 {
1147 return "Hello " + myresourcename;
1148 }
1149 }
1150 {{/code}}
1151
1152 The name of the component has to be the class FQN.
1153
1154 You can find more examples on [[this page>>https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest]].
1155
1156 The resource is expected to follow JAX-RS 1 specifications before XWiki 16.2.0 and JAX-RS 2.1 starting with XWiki 16.2.0.
1157
1158 Starting from release 4.3M2, the RESTful API modules have been refactored so that now resource declarations are available in a separate module.
1159 This means that all the information about resources, i.e., URI Paths, supported methods, query parameters, and so on, are available to module developers without having to include the big REST Server module.
1160
1161 Clients willing to access/use the REST API can then declare a dependency on xwiki-platform-rest-api and have all this information available for interacting with it. There are two use cases for this:
1162
1163 * Another platform module that wants to generate responses with links to existing resources.
1164 * HTTP clients that wants to make requests to the RESTful API.
1165
1166 The xwiki-platform-rest-api module can be also seen as an authoritative reference for the REST API.
1167
1168 = Generate a REST URL for a resource =
1169
1170 If you need to generate a REST URL as String for a resource inside a script, you can use the REST script services:
1171
1172 {{code language="velocity"}}
1173 ## Return a relative URL String unless the reference wiki is different from the current wiki
1174 $services.rest.url($entityReference)
1175
1176 ## Force returning an external form URL String, false as second parameter would have the same effect that the previous call
1177 $services.rest.url($entityReference, true)
1178
1179 ## String parameter automaticallly converter to entity reference
1180 $services.rest.url('MySpace.MyPage')
1181 $services.rest.url('document:MySpace.MyPage')
1182 $services.rest.url('space:MySpace')
1183 {{/code}}
1184
1185 Where ##$entityReference## could be:
1186
1187 * a ##DocumentReference##
1188 * a ##SpaceReference##
1189
1190 We plan to add more supported entities in the future (ObjectReference, ClassReference, etc...).
1191
1192 = Using the RESTful API =
1193
1194 {{info}}
1195 The examples below are using the ##~-~-data## (##-d##) parameter of the curl command to provide the data sent with the request, which may do some alteration on the content being actually sent (newlines, character set, etc.)
1196 There may be cases where you may need / want to use the ##~-~-data-binary## parameter, in order to send the data as-is, especially when manipulating page content, in which the newlines are relevant.
1197 {{/info}}
1198
1199 == Tutorial ==
1200
1201 See [[this tutorial>>http://blog.fabio.mancinelli.me/2011/03/07/XWikis_RESTful_API.html]] by Fabio Mancinelli.
1202
1203 == Creating an XWiki Object ==
1204
1205 In this example we will use the [[curl>>http://curl.haxx.se/]] utility as the HTTP client.
1206
1207 Imagine that you want to create on the page Test.Test a new object of the class XWiki.TestClass, supposing that the class has a property called ##text##.
1208
1209 So, on the command line, you have to do the following:
1210
1211 {{code}}
1212 $ curl -u Admin:admin
1213 -X POST
1214 -H "Content-type: application/xml"
1215 -H "Accept: application/xml"
1216 -d "@test.xml"
1217 http://localhost/xwiki/rest/wikis/xwiki/spaces/Test/pages/Test/objects
1218 {{/code}}
1219
1220 where ##test.xml## is:
1221
1222 {{code language="xml"}}
1223 <object xmlns="http://www.xwiki.org">
1224 <className>XWiki.TestClass</className>
1225 <property name="text">
1226 <value>Whatever you want to put here</value>
1227 </property>
1228 </object>
1229 {{/code}}
1230
1231 Alternatively you can use the less verbose ##application/x-www-form-urlencoded format##:
1232
1233 {{code}}
1234 $ curl -u Admin:admin
1235 -X POST
1236 -H "Content-type: application/x-www-form-urlencoded"
1237 -H "Accept: application/xml"
1238 -d "@test.txt"
1239 http://localhost/xwiki/rest/wikis/xwiki/spaces/Test/pages/Test/objects
1240 {{/code}}
1241
1242 where ##test.txt## contains something like:
1243
1244 {{code}}
1245 className=XWiki.TestClass&property#test=Whatever+you+want
1246 {{/code}}
1247
1248 Or, better, you can use directly curl to specify these parameters
1249 using multiple ##-d## switches:
1250
1251 {{code}}
1252 $ curl -u Admin:admin
1253 -X POST -H "Content-type: application/x-www-form-urlencoded"
1254 -H "Accept: application/xml"
1255 -d "className=XWiki.TestClass"
1256 -d "property#test=Whatever you want"
1257 http://localhost/xwiki/rest/wikis/xwiki/spaces/Test/pages/Test/objects
1258 {{/code}}
1259
1260 The advantage of the second approach is that curl will take care of url-encode your content, while if you send a file you are responsible for this.
1261
1262 === Remarks: ===
1263
1264 * In the ##application/x-www-form-urlencoded## format the "property#" is a standard immutable prefix that is used to distinguish attributes referring to property values from the attributes referring to the object. For example if we had ##className=XYZ&Text=FOO## we would have had an ambiguity on ##className## because we couldn't understand if ##className## is a property of the object to be set to XYZ or an attribute that describes the object itself (i.e., its metadata like the ##className##). By having the ##property### prefix this ambiguity is resolved.
1265
1266 * The information you get back when you retrieve an object (i.e., all
1267 the ##<attribute>## elements) are useful when clients need to understand the type of data contained in an object (e.g., when they want to display it). They are not necessary when creating an object because the system already has this information. That's why the XML to be sent is smaller. Actually the only information needed is the ##<className>## and a set of ##<property name="..."><value>## elements.
1268
1269 * How do you know what kind of information you can send with the XML? You can discover it by using the class description URI. If you go to ##http:~/~/localhost:8080/xwiki/rest/wikis/xwiki/classes ## you will get a list of all the classes defined in the Wiki. By looking at this you will understand what are the properties defined by each class, their types and attributes. In that way you will know what you're allowed to put in the ##<property><value>## elements of the XML you send.
1270
1271 == Formats of files ==
1272
1273 A XSD schema exists for XWiki (look [[here>>https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-model/src/main/resources/xwiki.rest.model.xsd]] for the source).
1274
1275 However, you may not know exactly how to write the XML files to use when using the PUT method. First thing to know, you may try to get examples by using ##GET## HTTP request to the REST service using cURL or similar tools.
1276
1277 But in order to help you, you'll find below the different formats that you can use. Note that the following XML files are exhaustive files but not all the elements are required.
1278
1279 === Example of a file for a ##wiki## ===
1280
1281 {{code language="xml"}}
1282
1283 <wiki xmlns="http://www.xwiki.org">
1284 <id>xwiki</id>
1285 <name>xwiki</name>
1286 <description>Some description of the wiki</description>
1287 <owner>Admin</owner>
1288 </wiki>
1289 {{/code}}
1290
1291 === Example of a file for a ##space## ===
1292
1293 {{code language="xml"}}
1294
1295 <space xmlns="http://www.xwiki.org">
1296 <id>xwiki:Main</id>
1297 <wiki>xwiki</wiki>
1298 <name>Main</name>
1299 <home>xwiki:Main.WebHome</home>
1300 <xwikiRelativeUrl>http://localhost:8080/xwiki/bin/view/Main/</xwikiRelativeUrl>
1301 <xwikiAbsoluteUrl>http://localhost:8080/xwiki/bin/view/Main/</xwikiAbsoluteUrl>
1302 </space>
1303 {{/code}}
1304
1305 === Example of a file for a ##page## ===
1306
1307 {{code language="xml"}}
1308
1309 <page xmlns="http://www.xwiki.org">
1310 <id>xwiki:Main.WebHome</id>
1311 <fullName>Main.WebHome</fullName>
1312 <wiki>xwiki</wiki>
1313 <space>Main</space>
1314 <name>WebHome</name>
1315 <title>Home</title>
1316 <parent></parent>
1317 <parentId></parentId>
1318 <version>1.1</version>
1319 <author>XWiki.Admin</author>
1320 <authorName>Administrator</authorName>
1321 <xwikiRelativeUrl>http://localhost:8080/xwiki/bin/view/Main/</xwikiRelativeUrl>
1322 <xwikiAbsoluteUrl>http://localhost:8080/xwiki/bin/view/Main/</xwikiAbsoluteUrl>
1323 <translations></translations>
1324 <syntax>xwiki/2.0</syntax>
1325 <language></language>
1326 <majorVersion>1</majorVersion>
1327 <minorVersion>1</minorVersion>
1328 <hidden>false</hidden>
1329 <created>2009-09-09T02:00:00+02:00</created>
1330 <creator>XWiki.Admin</creator>
1331 <creatorName>Administrator</creatorName>
1332 <modified>2015-10-29T11:19:02+01:00</modified>
1333 <modifier>XWiki.Admin</modifier>
1334 <modifierName>Administrator</modifierName>
1335 <comment>Imported from XAR</comment>
1336 <content>{{include reference="Dashboard.WebHome" context="new"/}}</content>
1337 </page>
1338 {{/code}}
1339
1340 === Example of a file for a ##tag## ===
1341
1342 {{code language="xml"}}
1343 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1344 <tags xmlns="http://www.xwiki.org">
1345 <tag name="food"></tag>
1346 </tags>
1347 {{/code}}
1348
1349 === Example of a file for a ##comment## ===
1350
1351 {{code language="xml"}}
1352 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1353 <comments xmlns="http://www.xwiki.org">
1354 <comment>
1355 <id>0</id>
1356 <pageId>xwiki:Main.WebHome</pageId>
1357 <author>XWiki.Admin</author>
1358 <authorName>Administrator</authorName>
1359 <date>2015-11-13T18:20:51.936+01:00</date>
1360 <highlight></highlight>
1361 <text>This is a comment</text>
1362 <replyTo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"></replyTo>
1363 </comment>
1364 </comments>
1365 {{/code}}
1366
1367 === Example of a file for an ##object## ===
1368
1369 {{code language="xml"}}
1370 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1371 <object xmlns="http://www.xwiki.org">
1372 <id>xwiki:Main.WebHome:c170a0a8-cc17-41cd-aa1e-6f6faf1d9f28</id>
1373 <guid>c170a0a8-cc17-41cd-aa1e-6f6faf1d9f28</guid>
1374 <pageId>xwiki:Main.WebHome</pageId>
1375 <pageVersion>1.1</pageVersion>
1376 <wiki>xwiki</wiki>
1377 <space>Main</space>
1378 <pageName>WebHome</pageName>
1379 <pageAuthor>XWiki.superadmin</pageAuthor>
1380 <className>XWiki.EditModeClass</className>
1381 <number>0</number>
1382 <headline>edit</headline>
1383 <property name="defaultEditMode" type="String">
1384 <attribute name="name" value="defaultEditMode"></attribute>
1385 <attribute name="prettyName" value="Default Edit Mode"></attribute>
1386 <attribute name="unmodifiable" value="0"></attribute>
1387 <attribute name="disabled" value="0"></attribute>
1388 <attribute name="size" value="15"></attribute>
1389 <attribute name="number" value="1"></attribute>
1390 <value>edit</value>
1391 </property>
1392 </object>
1393 {{/code}}
1394
1395 === Example of a file for a ##property## ===
1396
1397 {{code language="xml"}}
1398 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1399 <property xmlns="http://www.xwiki.org" name="defaultEditMode" type="String">
1400 <attribute name="name" value="defaultEditMode"></attribute>
1401 <attribute name="prettyName" value="Default Edit Mode"></attribute>
1402 <attribute name="unmodifiable" value="0"></attribute>
1403 <attribute name="disabled" value="0"></attribute>
1404 <attribute name="size" value="15"></attribute>
1405 <attribute name="number" value="1"></attribute>
1406 <value>edit</value>
1407 </property>
1408 {{/code}}
1409
1410 = Examples =
1411
1412 == Getting the list of users ==
1413
1414 Since Users are stored as Objects, you can do a search of the type ##XWiki.XWikiUsers##. For example:
1415
1416 {{code}}
1417 http://<server>/xwiki/rest/wikis/query?q=object:XWiki.XWikiUsers
1418 {{/code}}
1419
1420 == Getting the list of users using XWQL ==
1421
1422 Using the parameter "className" the result includes the data for the first object of the ##XWiki.XWikiUsers##:
1423
1424 {{code}}
1425 http://<server>/xwiki/rest/wikis/xwiki/query?q=,doc.object(XWiki.XWikiUsers) as obj&type=xwql&className=XWiki.XWikiUsers
1426 {{/code}}
1427
1428 == Getting the list of inactive users using XWQL ==
1429
1430 Using the property "active" where the value is 0 (by replacing with value 1 result will include active users) the result includes the data for all objects of the ##XWiki.XWikiUsers##:
1431
1432 {{code}}
1433 http://<server>/xwiki/rest/wikis/xwiki/query?q=where doc.object(XWiki.XWikiUsers).active=0&type=xwql&className=XWiki.XWikiUsers
1434 {{/code}}
1435
1436 {{version since="17.5.0"}}
1437 = Configuration =
1438
1439 You can configure the backend that is used for keyword search at the [[wiki>>#H2Fwikis2F7BwikiName7D2Fsearch3Fq3D7Bkeywords7D5B5B26scope3D7Bname2Ccontent2Ctitle2Cobjects7D...5D26start3Dn5D5B26number3Dn5D5B26orderField3Dfield26order3D7Basc2Cdesc7D5D5Bdistinct3D7Btrue2Cfalse7D5D5B26prettyNames3D7Btrue2Cfalse7D5D]] and [[space>>#H2Fwikis2F7BwikiName7D2Fspaces2F7BspaceName7D5B2Fspaces2F7BnestedSpaceName7D5D2A2Fsearch3Fq3D7Bkeywords7D5B5B26scope3D7Bname2Ccontent2Ctitle2Cobjects7D...5D26number3Dn5D]] level in the ##xwiki.properties## configuration file. By default, the backend is Solr as it is more scalable in particular for big installations with more than 100k documents in a single wiki. For backwards-compatibility, you can change the backend to "database" to restore the exact behavior from before XWiki 17.5.0:
1440
1441 {{code language="none"}}
1442 #-# [Since 17.5.0]
1443 #-# The default source for keyword search results at the space and wiki level in the REST API.
1444 #-# Supported values: database, solr
1445 #-# Before 17.5.0, the database provided the search results. Since 17.5.0, the default "solr" source is the default
1446 #-# which provides much better performance in particular for large installations and allows more flexible queries.
1447 #-# You can change this back to "database" to restore the old behavior.
1448 # rest.keywordSearchSource=solr
1449 {{/code}}
1450 {{/version}}

Get Connected