Changes for page REST API

Last modified by Thomas Mortagne on 2024/03/12

<
From version < 84.1 >
edited by Thomas Mortagne
on 2021/06/24
To version < 89.1 >
edited by Ludovic Dubost
on 2021/06/24
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.ThomasMortagne
1 +XWiki.ludovic
Content
... ... @@ -118,7 +118,7 @@
118 118  $ curl http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome
119 119  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
120 120  <page xmlns="http://www.xwiki.org">
121 - <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
121 + <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
122 122   ...
123 123  {{/code}}
124 124  
... ... @@ -148,9 +148,9 @@
148 148  $ curl -u Admin:admin http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
149 149  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
150 150  <page xmlns="http://www.xwiki.org">
151 - <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
152 - ...
153 - <content>Only admin can see this</content>
151 + <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
152 + ...
153 + <content>Only admin can see this</content>
154 154  </page>
155 155  {{/code}}
156 156  
... ... @@ -167,16 +167,16 @@
167 167  $ 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
168 168  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
169 169  <page xmlns="http://www.xwiki.org">
170 - <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
170 + <link rel="http://www.xwiki.org/rel/space" href="http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main"/>
171 171   ...
172 172   <version>1.1</version>
173 - <majorVersion>1</majorVersion>
174 - <minorVersion>1</minorVersion>
175 - <created>2009-03-21+01:00</created>
176 - <creator>XWiki.Admin</creator>
177 - <modified>2009-03-21+01:00</modified>
178 - <modifier>XWiki.Admin</modifier>
179 - <content>This is a new page</content>
173 + <majorVersion>1</majorVersion>
174 + <minorVersion>1</minorVersion>
175 + <created>2009-03-21+01:00</created>
176 + <creator>XWiki.Admin</creator>
177 + <modified>2009-03-21+01:00</modified>
178 + <modifier>XWiki.Admin</modifier>
179 + <content>This is a new page</content>
180 180  </page>
181 181  {{/code}}
182 182  
... ... @@ -227,7 +227,7 @@
227 227  === / ===
228 228  
229 229  * **HTTP Method:** GET
230 -** **Media types:**
230 +** **Media types:**
231 231  *** application/xml (XWiki element)
232 232  ** **Description:** Retrieves the entry root description containing information about the server (currently returns the XWiki product Version).
233 233  ** **Status codes:**
... ... @@ -245,7 +245,7 @@
245 245  === /wikis ===
246 246  
247 247  * **HTTP Method:** GET
248 -** **Media types:**
248 +** **Media types:**
249 249  *** application/xml (Wikis element)
250 250  ** **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'.
251 251  ** **Status codes:**
... ... @@ -254,7 +254,7 @@
254 254  === /wikis/query?q~={query}&wikis~=wikiList[&distinct~={true,false}][&order~={asc,desc}][&start~=n][&number~=n][&prettyNames~={true,false}] ===
255 255  
256 256  * **HTTP Method:** GET
257 -** **Media types:**
257 +** **Media types:**
258 258  *** application/xml (SearchResults element)
259 259  ** **Description:** Search resources (pages and attachments):
260 260  *** [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.
... ... @@ -286,7 +286,7 @@
286 286  === /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}] ===
287 287  
288 288  * **HTTP Method:** GET
289 -** **Media types:**
289 +** **Media types:**
290 290  *** application/xml (SearchResults element)
291 291  ** **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.
292 292  ** **Status codes:**
... ... @@ -295,7 +295,7 @@
295 295  === /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] ===
296 296  
297 297  * **HTTP Method:** GET
298 -** **Media types:**
298 +** **Media types:**
299 299  *** application/xml (SearchResults element)
300 300  ** **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>>platform:DevGuide.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.
301 301  ** **Status codes:**
... ... @@ -320,7 +320,7 @@
320 320  === /wikis/{wikiName}/spaces[?start~=offset&number~=n] ===
321 321  
322 322  * **HTTP Method:** GET
323 -** **Media types:**
323 +** **Media types:**
324 324  *** application/xml (Spaces element)
325 325  ** **Description:** Retrieves the list of spaces available in the {wikiName} wiki.
326 326  ** **Status codes:**
... ... @@ -329,7 +329,7 @@
329 329  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/search?q~={keywords}~[~[&scope~={name,content,title,objects}...]&number~=n] ===
330 330  
331 331  * **HTTP Method:** GET
332 -** **Media types:**
332 +** **Media types:**
333 333  *** application/xml (Search results element)
334 334  ** **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}
335 335  ** **Status codes:**
... ... @@ -341,7 +341,7 @@
341 341  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages[?start~=offset&number~=n] ===
342 342  
343 343  * **HTTP Method:** GET
344 -** **Media types:**
344 +** **Media types:**
345 345  *** application/xml (Pages element)
346 346  ** **Description:** The list of pages in the space {spaceName}
347 347  ** **Status codes:**
... ... @@ -351,7 +351,7 @@
351 351  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}[?prettyNames~={true,false}&objects~={true,false}&class~={true,false}&attachments~={true,false}&minorRevision~={true,false}] ===
352 352  
353 353  * **HTTP Method:** GET
354 -** **Media types:**
354 +** **Media types:**
355 355  *** application/xml (Page element)
356 356  ** **Query parameters**
357 357  *** ##prettyNames##: also return the pretty name for various document information (like the author display name, etc). Disabled by default.
... ... @@ -363,7 +363,6 @@
363 363  *** 200: If the request was successful.
364 364  *** 401: If the user is not authorized.
365 365  
366 -\\
367 367  
368 368  * **HTTP Method:** PUT
369 369  ** **Accepted Media types:**
... ... @@ -370,7 +370,7 @@
370 370  *** application/xml (Page element)
371 371  *** text/plain (Only page content)
372 372  *** application/x-www-form-urlencoded (allowed field names: title, parent, hidden //[since 7.3]//, content)
373 -** **Media types:**
372 +** **Media types:**
374 374  *** application/xml (Page element)
375 375  ** **Query parameters**
376 376  *** ##minorRevision## ({{info}}Since 9.11.4 & 10.2RC1{{/info}}): Create a minor revision for the page. Disabled by default.
... ... @@ -381,10 +381,9 @@
381 381  *** 304: If the page was not modified.
382 382  *** 401: If the user is not authorized.
383 383  
384 -\\
385 385  
386 386  * **HTTP Method:** DELETE
387 -** **Media types:**
385 +** **Media types:**
388 388  *** application/xml (Page element)
389 389  ** **Description:** Delete the page.
390 390  ** **Status codes:**
... ... @@ -394,7 +394,7 @@
394 394  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history[?start~=offset&number~=n] ===
395 395  
396 396  * **HTTP Method:** GET
397 -** **Media types:**
395 +** **Media types:**
398 398  *** application/xml (History element)
399 399  ** **Description:** The list of all the versions of the given page.
400 400  ** **Status codes:**
... ... @@ -404,7 +404,7 @@
404 404  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version} ===
405 405  
406 406  * **HTTP Method:** GET
407 -** **Media types:**
405 +** **Media types:**
408 408  *** application/xml (Page element)
409 409  ** **Description:** The page at version {version}
410 410  ** **Status codes:**
... ... @@ -414,7 +414,7 @@
414 414  ==== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations[?start~=offset&number~=n] ====
415 415  
416 416  * **HTTP Method:** GET
417 -** **Media types:**
415 +** **Media types:**
418 418  *** application/xml (Translations element)
419 419  ** **Description:** The list of available translation for the page
420 420  ** **Status codes:**
... ... @@ -424,7 +424,7 @@
424 424  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations/{language}[?minorRevision~={true,false}] ===
425 425  
426 426  * **HTTP Method:** GET
427 -** **Media types:**
425 +** **Media types:**
428 428  *** application/xml (Page element)
429 429  ** **Description:** The page at in the given {language}.
430 430  ** **Status codes:**
... ... @@ -431,7 +431,6 @@
431 431  *** 200: If the request was successful.
432 432  *** 401: If the user is not authorized.
433 433  
434 -\\
435 435  
436 436  * **HTTP Method:** PUT
437 437  ** **Accepted Media types:**
... ... @@ -438,7 +438,7 @@
438 438  *** application/xml (Page element)
439 439  *** text/plain (Only page content)
440 440  *** application/x-www-form-urlencoded (allowed field names: title, parent, content)
441 -** **Media types:**
438 +** **Media types:**
442 442  *** application/xml (Page element)
443 443  ** **Query parameters**
444 444  *** ##minorRevision## ({{info}}Since 9.11.4 & 10.2RC1{{/info}}): Create a minor revision for the page. Disabled by default.
... ... @@ -449,10 +449,9 @@
449 449  *** 304: If the page was not modified.
450 450  *** 401: If the user is not authorized.
451 451  
452 -\\
453 453  
454 454  * **HTTP Method:** DELETE
455 -** **Media types:**
451 +** **Media types:**
456 456  *** application/xml (Page element)
457 457  ** **Description:** Delete the page translation.
458 458  ** **Status codes:**
... ... @@ -462,7 +462,7 @@
462 462  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations/{language}/history ===
463 463  
464 464  * **HTTP Method:** GET
465 -** **Media types:**
461 +** **Media types:**
466 466  *** application/xml (History element)
467 467  ** **Description:** The list of all the available revisions of the page in a given {language}.
468 468  ** **Status codes:**
... ... @@ -472,7 +472,7 @@
472 472  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations/{lang}/history/{version} ===
473 473  
474 474  * **HTTP Method:** GET
475 -** **Media types:**
471 +** **Media types:**
476 476  *** application/xml (Page element)
477 477  ** **Description:** A page at a given {version} in a given {language}.
478 478  ** **Status codes:**
... ... @@ -482,7 +482,7 @@
482 482  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/children ===
483 483  
484 484  * **HTTP Method:** GET
485 -** **Media types:**
481 +** **Media types:**
486 486  *** application/xml (Pages element)
487 487  ** **Description:** The list of the children of a given page.
488 488  ** **Status codes:**
... ... @@ -492,7 +492,7 @@
492 492  === /wikis/{wikiName}/pages[?name~=paneName&space~=spaceName&author~=authorName] ===
493 493  
494 494  * **HTTP Method:** GET
495 -** **Media types:**
491 +** **Media types:**
496 496  *** application/xml (Pages element)
497 497  ** **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.
498 498  ** **Status codes:**
... ... @@ -504,7 +504,7 @@
504 504  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/tags[?minorRevision~={true,false}] ===
505 505  
506 506  * **HTTP Method:** GET
507 -** **Media types:**
503 +** **Media types:**
508 508  *** application/xml (Tags element)
509 509  ** **Description:** List page tags.
510 510  ** **Status codes:**
... ... @@ -511,7 +511,6 @@
511 511  *** 200: If the request was successful.
512 512  *** 401: If the user is not authorized.
513 513  
514 -\\
515 515  
516 516  * **HTTP Method:** PUT
517 517  ** **Accepted Media types:**
... ... @@ -518,7 +518,7 @@
518 518  *** application/xml (Tag element)
519 519  *** text/plain
520 520  *** application/x-www-form-urlencoded (allowed field names: tag)
521 -** **Media types:**
516 +** **Media types:**
522 522  *** application/xml (Tags element)
523 523  ** **Query parameters**
524 524  *** ##minorRevision## ({{info}}Since 9.11.4 & 10.2RC1{{/info}}): Create a minor revision for the page. Disabled by default.
... ... @@ -530,7 +530,7 @@
530 530  === /wikis/{wikiName}/tags ===
531 531  
532 532  * **HTTP Method:** GET
533 -** **Media types:**
528 +** **Media types:**
534 534  *** application/xml (Tags element)
535 535  ** **Description:** The list of all available tags
536 536  ** **Status codes:**
... ... @@ -540,7 +540,7 @@
540 540  === /wikis/{wikiName}/tags/{tag1}[,{tag2},{tag3}...][?start~=offset&number~=n] ===
541 541  
542 542  * **HTTP Method:** GET
543 -** **Media types:**
538 +** **Media types:**
544 544  *** application/xml (Pages element)
545 545  ** **Description:** The list of pages having the specified tags.
546 546  ** **Status codes:**
... ... @@ -552,7 +552,7 @@
552 552  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/comments[?start~=offset&number~=n] ===
553 553  
554 554  * **HTTP Method:** GET
555 -** **Media types:**
550 +** **Media types:**
556 556  *** application/xml (Comments element)
557 557  ** **Description:** The list of comments on a given page.
558 558  ** **Status codes:**
... ... @@ -559,7 +559,6 @@
559 559  *** 200: If the request was successful.
560 560  *** 401: If the user is not authorized.
561 561  
562 -\\
563 563  
564 564  * **HTTP Method:** POST
565 565  ** **Accepted Media types:**
... ... @@ -566,7 +566,7 @@
566 566  *** application/xml (Comment element)
567 567  *** text/plain
568 568  *** application/x-www-form-urlencoded - allowed field names: ##text##, ##replyTo## (object number of the replied comment, since XE 2.3)
569 -** **Media types:**
563 +** **Media types:**
570 570  *** application/xml (Comment element)
571 571  ** **Description:** Create a comment on the given page.
572 572  ** **Status codes:**
... ... @@ -576,7 +576,7 @@
576 576  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/comments/{commentId} ===
577 577  
578 578  * **HTTP Method:** GET
579 -** **Media types:**
573 +** **Media types:**
580 580  *** application/xml (Comment element)
581 581  ** **Description:** A specific comment on a page
582 582  ** **Status codes:**
... ... @@ -586,7 +586,7 @@
586 586  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/comments ===
587 587  
588 588  * **HTTP Method:** GET
589 -** **Media types:**
583 +** **Media types:**
590 590  *** application/xml (Comments element)
591 591  ** **Description:** The list of comments at a specific page {version}.
592 592  ** **Status codes:**
... ... @@ -596,7 +596,7 @@
596 596  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/comments/{commentId} ===
597 597  
598 598  * **HTTP Method:** GET
599 -** **Media types:**
593 +** **Media types:**
600 600  *** application/xml (Comment element)
601 601  ** **Description:** A comment at a specific page {version}.
602 602  ** **Status codes:**
... ... @@ -608,7 +608,7 @@
608 608  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments[?start~=offset&number~=n] ===
609 609  
610 610  * **HTTP Method:** GET
611 -** **Media types:**
605 +** **Media types:**
612 612  *** application/xml (Attachments element)
613 613  ** **Description:** The list of attachments of a given page.
614 614  ** **Status codes:**
... ... @@ -618,7 +618,7 @@
618 618  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments/{attachmentName} ===
619 619  
620 620  * **HTTP Method:** GET
621 -** **Media types:**
615 +** **Media types:**
622 622  *** The same of the attachment media type.
623 623  ** **Description:** The attachment identified by {attachmentName} on a given page.
624 624  ** **Status codes:**
... ... @@ -625,12 +625,11 @@
625 625  *** 200: If the request was successful.
626 626  *** 401: If the user is not authorized.
627 627  
628 -\\
629 629  
630 630  * **HTTP Method:** PUT
631 631  ** **Accepted media types:**
632 632  *** **/**
633 -** **Media types:**
626 +** **Media types:**
634 634  *** application/xml (AttachmentSummary element)
635 635  ** **Description:** Create an attachment identified by {attachmentName} on a given page.
636 636  ** **Status codes:**
... ... @@ -638,7 +638,6 @@
638 638  *** 202: If the attachment was updated.
639 639  *** 401: If the user is not authorized.
640 640  
641 -\\
642 642  
643 643  * **HTTP Method:** DELETE
644 644  ** **Media types:**
... ... @@ -650,7 +650,7 @@
650 650  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/attachments[?start~=offset&number~=n] ===
651 651  
652 652  * **HTTP Method:** GET
653 -** **Media types:**
645 +** **Media types:**
654 654  *** application/xml (Attachments element)
655 655  ** **Description:** The list of attachments at a given page {version}.
656 656  ** **Status codes:**
... ... @@ -660,7 +660,7 @@
660 660  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/attachments/{attachmentName} ===
661 661  
662 662  * **HTTP Method:** GET
663 -** **Media types:**
655 +** **Media types:**
664 664  *** The same of the attachment media type.
665 665  ** **Description:** The attachment identified by {attachmentName} on a given page {version}.
666 666  ** **Status codes:**
... ... @@ -670,7 +670,7 @@
670 670  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments/{attachmentName}/history ===
671 671  
672 672  * **HTTP Method:** GET
673 -** **Media types:**
665 +** **Media types:**
674 674  *** application/xml (Attachments element)
675 675  ** **Description:** The list of available version for the {attachmentName}
676 676  ** **Status codes:**
... ... @@ -680,7 +680,7 @@
680 680  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments/{attachmentName}/history/{version} ===
681 681  
682 682  * **HTTP Method:** GET
683 -** **Media types:**
675 +** **Media types:**
684 684  *** The same of the attachment media type.
685 685  ** **Description:** The {attachmentName} at a given {version}
686 686  ** **Status codes:**
... ... @@ -690,7 +690,7 @@
690 690  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/attachments[?name~=attachmentName&page~=pageName&author~=authorName&types~=attachmentTypeList&start~=offset&number~=n] ===
691 691  
692 692  * **HTTP Method:** GET
693 -** **Media types:**
685 +** **Media types:**
694 694  *** application/xml (Attachments element)
695 695  ** **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.
696 696  ** **Status codes:**
... ... @@ -700,7 +700,7 @@
700 700  === /wikis/{wikiName}/attachments[?name~=attachmentName&page~=pageName&space~=spaceName&author~=authorName&types~=attachmentTypeList&start~=offset&number~=n] ===
701 701  
702 702  * **HTTP Method:** GET
703 -** **Media types:**
695 +** **Media types:**
704 704  *** application/xml (Attachments element)
705 705  ** **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.
706 706  ** **Status codes:**
... ... @@ -712,7 +712,7 @@
712 712  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects[?start~=offset&number~=n] ===
713 713  
714 714  * **HTTP Method:** GET
715 -** **Media types:**
707 +** **Media types:**
716 716  *** application/xml (Objects element)
717 717  ** **Description:** The list of objects associated to a page.
718 718  ** **Status codes:**
... ... @@ -719,7 +719,6 @@
719 719  *** 200: If the request was successful.
720 720  *** 401: If the user is not authorized.
721 721  
722 -\\
723 723  
724 724  * **HTTP Method:** POST
725 725  ** **Accepted media types:**
... ... @@ -726,7 +726,7 @@
726 726  *** application/xml (Object element)
727 727  *** application/x-www-form-urlencoded (a set of property#name=value pairs representing properties and a field className)
728 728  **** e.g. {{code language="none"}}className=XWiki.XWikiUsers&property#first_name=John&property#last_name=Doe{{/code}}
729 -** **Media types:**
720 +** **Media types:**
730 730  *** application/xml (Object element)
731 731  ** **Description:** Create a new object.
732 732  ** **Status codes:**
... ... @@ -736,7 +736,7 @@
736 736  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}[?start~=offset&number~=n] ===
737 737  
738 738  * **HTTP Method:** GET
739 -** **Media types:**
730 +** **Media types:**
740 740  *** application/xml (Objects element)
741 741  ** **Description:** The list of objects of a given {className} associated to a page.
742 742  ** **Status codes:**
... ... @@ -746,7 +746,7 @@
746 746  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}/{objectNumber}[?minorRevision~={true,false}] ===
747 747  
748 748  * **HTTP Method:** GET
749 -** **Media types:**
740 +** **Media types:**
750 750  *** application/xml (Object element)
751 751  ** **Description:** The object of type {className} identified by {objectNumber} associated to the given page.
752 752  ** **Status codes:**
... ... @@ -753,13 +753,12 @@
753 753  *** 200: If the request was successful.
754 754  *** 401: If the user is not authorized.
755 755  
756 -\\
757 757  
758 758  * **HTTP Method:** PUT
759 759  ** **Accepted media types:**
760 760  *** application/xml (Object element)
761 761  *** application/x-www-form-urlencoded (a set of property#name=value pairs representing properties)
762 -** **Media types:**
752 +** **Media types:**
763 763  *** application/xml (Object element)
764 764  ** **Query parameters**
765 765  *** ##minorRevision## ({{info}}Since 9.11.4 & 10.2RC1{{/info}}): Create a minor revision for the page. Disabled by default.
... ... @@ -768,7 +768,6 @@
768 768  *** 202: If the object was updated.
769 769  *** 401: If the user is not authorized.
770 770  
771 -\\
772 772  
773 773  * **HTTP Method:** DELETE
774 774  ** **Media types:**
... ... @@ -780,7 +780,7 @@
780 780  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}/{objectNumber}/properties ===
781 781  
782 782  * **HTTP Method:** GET
783 -** **Media types:**
772 +** **Media types:**
784 784  *** application/xml (Properties element)
785 785  ** **Description:** The properties of the object of type {className} identified by {objectNumber} associated to the given page.
786 786  ** **Status codes:**
... ... @@ -790,7 +790,7 @@
790 790  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}/{objectNumber}/properties/{propertyName}[?minorRevision~={true,false}] ===
791 791  
792 792  * **HTTP Method:** GET
793 -** **Media types:**
782 +** **Media types:**
794 794  *** application/xml (Properties element)
795 795  ** **Description:** The property {propertyname} of the object of type {className} identified by {objectNumber} associated to the given page.
796 796  ** **Status codes:**
... ... @@ -797,7 +797,6 @@
797 797  *** 200: If the request was successful.
798 798  *** 401: If the user is not authorized.
799 799  
800 -\\
801 801  
802 802  * **HTTP Method:** PUT
803 803  ** **Accepted media types:**
... ... @@ -804,7 +804,7 @@
804 804  *** application/xml (Property element)
805 805  *** text/plain
806 806  *** application/x-www-form-urlencoded (a field property#name=value pairs representing a property)
807 -** **Media types:**
795 +** **Media types:**
808 808  *** application/xml (Property element)
809 809  ** **Query parameters**
810 810  *** ##minorRevision## ({{info}}Since 9.11.4 & 10.2RC1{{/info}}): Create a minor revision for the page. Disabled by default.
... ... @@ -816,7 +816,7 @@
816 816  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects[?start~=offset&number~=n] ===
817 817  
818 818  * **HTTP Method:** GET
819 -** **Media types:**
807 +** **Media types:**
820 820  *** application/xml (Objects element)
821 821  ** **Description:** The list of objects associated to a page at a given {version}.
822 822  ** **Status codes:**
... ... @@ -826,7 +826,7 @@
826 826  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects/{className}/{objectNumber} ===
827 827  
828 828  * **HTTP Method:** GET
829 -** **Media types:**
817 +** **Media types:**
830 830  *** application/xml (Object element)
831 831  ** **Description:** The object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
832 832  ** **Status codes:**
... ... @@ -836,7 +836,7 @@
836 836  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties ===
837 837  
838 838  * **HTTP Method:** GET
839 -** **Media types:**
827 +** **Media types:**
840 840  *** application/xml (Properties element)
841 841  ** **Description:** The properties of the object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
842 842  ** **Status codes:**
... ... @@ -846,7 +846,7 @@
846 846  === /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties/{propertyName} ===
847 847  
848 848  * **HTTP Method:** GET
849 -** **Media types:**
837 +** **Media types:**
850 850  *** application/xml (Properties element)
851 851  ** **Description:** The property {propertyName} of the object of type {className} identified by {objectNumber} associated to the given page at a given {version}.
852 852  ** **Status codes:**
... ... @@ -856,7 +856,7 @@
856 856  === /wikis/{wikiName}/classes/{className}/objects[?start~=offset&number~=n] ===
857 857  
858 858  * **HTTP Method:** GET
859 -** **Media types:**
847 +** **Media types:**
860 860  *** application/xml (Objects element)
861 861  ** **Description:** The list of all the objects of a given {className}.
862 862  ** **Status codes:**
... ... @@ -868,7 +868,7 @@
868 868  === /wikis/{wikiName}/classes[?start~=offset&number~=n] ===
869 869  
870 870  * **HTTP Method:** GET
871 -** **Media types:**
859 +** **Media types:**
872 872  *** application/xml (Classes element)
873 873  ** **Description:** The list of all the classes defined in the wiki {wikiName}
874 874  ** **Status codes:**
... ... @@ -878,7 +878,7 @@
878 878  === /wikis/{wikiName}/classes/{className} ===
879 879  
880 880  * **HTTP Method:** GET
881 -** **Media types:**
869 +** **Media types:**
882 882  *** application/xml (Class element)
883 883  ** **Description:** The {className} definition
884 884  ** **Status codes:**
... ... @@ -888,7 +888,7 @@
888 888  === /wikis/{wikiName}/classes/{className}/properties ===
889 889  
890 890  * **HTTP Method:** GET
891 -** **Media types:**
879 +** **Media types:**
892 892  *** application/xml (Properties element)
893 893  ** **Description:** The properties of the class {className}.
894 894  ** **Status codes:**
... ... @@ -898,7 +898,7 @@
898 898  === /wikis/{wikiName}/classes/{className}/properties/{propertyName} ===
899 899  
900 900  * **HTTP Method:** GET
901 -** **Media types:**
889 +** **Media types:**
902 902  *** application/xml (Property element)
903 903  ** **Description:** The property {propertyName} of the class {className}.
904 904  ** **Status codes:**
... ... @@ -909,12 +909,12 @@
909 909  
910 910  Request parameters:
911 911  
912 -|=Name|=Description|\\
900 +|=Name|=Description|
913 913  |limit|Limit the number of values returned. Zero or a negative number means no limit.
914 914  |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.
915 915  
916 916  * **HTTP Method:** GET
917 -** **Media types:**
905 +** **Media types:**
918 918  *** application/xml (Property element)
919 919  ** **Description:** The list of values for the property {propertyName} of the class {className}. At the moment only Database List properties are supported.
920 920  ** **Status codes:**
... ... @@ -934,7 +934,7 @@
934 934  |##request##|no|##true~|false##|##false##|Return also the job request|9.1RC1
935 935  |##progress##|no|##true~|false##|##true##|Return also the job progress|9.1RC1
936 936  |##log##|no|##true~|false##|##false##|Return also the job log|9.1RC1
937 -|##log_fromLevel##|no|##error~|warn~|info~|debug~|trace##||Indicate the level from which to return logs|9.1RC1
925 +|##log_fromLevel##|no|##error~|warn~|info~|debug~|trace##| |Indicate the level from which to return logs|9.1RC1
938 938  
939 939  * **HTTP Method:** GET
940 940  ** **Media types:**
... ... @@ -949,8 +949,8 @@
949 949  Request parameters:
950 950  
951 951  |=Name|=Required|=Values|=Default|=Description|=Version
952 -|##level##|no|##error~|warn~|info~|debug~|trace##||Indicate the exact level for which to return logs|7.2M3
953 -|##fromLevel##|no|##error~|warn~|info~|debug~|trace##||Indicate the level from which to return logs|7.2M3
940 +|##level##|no|##error~|warn~|info~|debug~|trace##| |Indicate the exact level for which to return logs|7.2M3
941 +|##fromLevel##|no|##error~|warn~|info~|debug~|trace##| |Indicate the level from which to return logs|7.2M3
954 954  
955 955  * **HTTP Method:** GET
956 956  ** **Media types:**
... ... @@ -965,17 +965,11 @@
965 965  Request parameters:
966 966  
967 967  |=Name|=Required|=Values|=Default|=Description|=Version
968 -|##jobType##|yes|||The type of the job to pass to the Job Executor|9.1RC1
956 +|##jobType##|yes| | |The type of the job to pass to the Job Executor|9.1RC1
969 969  |##async##|no|##true~|false##|##true##|If false, return the response only when the job is done|9.1RC1
970 970  
971 971  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.). There is JAXB objects provided for the Java side to help generate proper HTTP request but for pure HTTP use case it usually helps to ask for the status of an existing job to have an hint of how the XML/JSON should look like (see [[jobstatus section>>#H2Fjobstatus2F7BjobId7D]]).
972 972  
973 -Since 9.2RC1 jobs started trough the REST API automatically get their runtime context injected with the following REST HTTP request context properties:
974 -
975 -* current wiki
976 -* current user
977 -* request URL and parameters
978 -
979 979  * **HTTP Method:** PUT
980 980  ** **Input:**
981 981  *** Media Types: ##application/xml## or ##application/json##
... ... @@ -989,6 +989,20 @@
989 989  *** 401: If the user is not authorized (i.e. doesn't have Programming Rights)
990 990  *** 500: Failing jobs with ##async=false## return an error 500 (Since 9.7RC1)
991 991  
974 +Jobs started through the REST API automatically get their runtime context injected with the following REST HTTP request context properties:
975 +
976 +* current wiki
977 +* current user
978 +* request URL and parameters
979 +
980 +=== Example of Extension Manager installJob ===
981 +
982 +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):
983 +
984 +{{code language="none"}}
985 +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
986 +{{/code}}
987 +
992 992  == Localization resources ==
993 993  
994 994  For more details see the [[Localization Module documentation>>extensions:Extension.Localization.WebHome]].
... ... @@ -1045,7 +1045,7 @@
1045 1045  === /wikis/{wikiName}/modifications[?start~=offset&number~=n&date~=t] ===
1046 1046  
1047 1047  * **HTTP Method:** GET
1048 -** **Media types:**
1044 +** **Media types:**
1049 1049  *** application/xml (Modifications element)
1050 1050  ** **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)
1051 1051  ** **Status codes:**
... ... @@ -1273,16 +1273,16 @@
1273 1273   <space>Main</space>
1274 1274   <name>WebHome</name>
1275 1275   <title>Home</title>
1276 - <parent/>
1277 - <parentId/>
1272 + <parent></parent>
1273 + <parentId></parentId>
1278 1278   <version>1.1</version>
1279 1279   <author>XWiki.Admin</author>
1280 1280   <authorName>Administrator</authorName>
1281 1281   <xwikiRelativeUrl>http://localhost:8080/xwiki/bin/view/Main/</xwikiRelativeUrl>
1282 1282   <xwikiAbsoluteUrl>http://localhost:8080/xwiki/bin/view/Main/</xwikiAbsoluteUrl>
1283 - <translations/>
1279 + <translations></translations>
1284 1284   <syntax>xwiki/2.0</syntax>
1285 - <language/>
1281 + <language></language>
1286 1286   <majorVersion>1</majorVersion>
1287 1287   <minorVersion>1</minorVersion>
1288 1288   <hidden>false</hidden>
... ... @@ -1317,9 +1317,9 @@
1317 1317   <author>XWiki.Admin</author>
1318 1318   <authorName>Administrator</authorName>
1319 1319   <date>2015-11-13T18:20:51.936+01:00</date>
1320 - <highlight/>
1316 + <highlight></highlight>
1321 1321   <text>This is a comment</text>
1322 - <replyTo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
1318 + <replyTo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"></replyTo>
1323 1323   </comment>
1324 1324  </comments>
1325 1325  {{/code}}
... ... @@ -1341,12 +1341,12 @@
1341 1341   <number>0</number>
1342 1342   <headline>edit</headline>
1343 1343   <property name="defaultEditMode" type="String">
1344 - <attribute name="name" value="defaultEditMode"/>
1345 - <attribute name="prettyName" value="Default Edit Mode"/>
1346 - <attribute name="unmodifiable" value="0"/>
1347 - <attribute name="disabled" value="0"/>
1348 - <attribute name="size" value="15"/>
1349 - <attribute name="number" value="1"/>
1340 + <attribute name="name" value="defaultEditMode"></attribute>
1341 + <attribute name="prettyName" value="Default Edit Mode"></attribute>
1342 + <attribute name="unmodifiable" value="0"></attribute>
1343 + <attribute name="disabled" value="0"></attribute>
1344 + <attribute name="size" value="15"></attribute>
1345 + <attribute name="number" value="1"></attribute>
1350 1350   <value>edit</value>
1351 1351   </property>
1352 1352  </object>
... ... @@ -1357,12 +1357,12 @@
1357 1357  {{code language="xml"}}
1358 1358  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1359 1359  <property xmlns="http://www.xwiki.org" name="defaultEditMode" type="String">
1360 - <attribute name="name" value="defaultEditMode"/>
1361 - <attribute name="prettyName" value="Default Edit Mode"/>
1362 - <attribute name="unmodifiable" value="0"/>
1363 - <attribute name="disabled" value="0"/>
1364 - <attribute name="size" value="15"/>
1365 - <attribute name="number" value="1"/>
1356 + <attribute name="name" value="defaultEditMode"></attribute>
1357 + <attribute name="prettyName" value="Default Edit Mode"></attribute>
1358 + <attribute name="unmodifiable" value="0"></attribute>
1359 + <attribute name="disabled" value="0"></attribute>
1360 + <attribute name="size" value="15"></attribute>
1361 + <attribute name="number" value="1"></attribute>
1366 1366   <value>edit</value>
1367 1367  </property>
1368 1368  {{/code}}
installjobrequest.xml
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.ludovic
Size
... ... @@ -1,0 +1,1 @@
1 +1.4 KB
Content
... ... @@ -1,0 +1,47 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 +<jobRequest xmlns="http://www.xwiki.org">
3 + <id>
4 + <element>extension</element>
5 + <element>provision</element>
6 + <element>796fb04f-b095-4db8-a3ec-fa03f22051f8</element>
7 + </id>
8 + <interactive>false</interactive>
9 + <remote>false</remote>
10 + <verbose>true</verbose>
11 + <property>
12 + <key>extensions</key>
13 + <value>
14 + <list xmlns="" xmlns:ns2="http://www.xwiki.org">
15 + <org.xwiki.extension.ExtensionId>
16 + <id>org.xwiki.contrib.oidc:oidc-authenticator</id>
17 + <version class="org.xwiki.extension.version.internal.DefaultVersion" serialization="custom">
18 + <org.xwiki.extension.version.internal.DefaultVersion>
19 + <string>1.28</string>
20 + </org.xwiki.extension.version.internal.DefaultVersion>
21 + </version>
22 + </org.xwiki.extension.ExtensionId>
23 + </list>
24 + </value>
25 + </property>
26 + <property>
27 + <key>extensions.excluded</key>
28 + <value>
29 + <set xmlns="" xmlns:ns2="http://www.xwiki.org"/>
30 + </value>
31 + </property>
32 + <property>
33 + <key>interactive</key>
34 + <value>
35 + <boolean xmlns="" xmlns:ns2="http://www.xwiki.org">false</boolean>
36 + </value>
37 + </property>
38 + <property>
39 + <key>namespaces</key>
40 + <value>
41 + <list xmlns="" xmlns:ns2="http://www.xwiki.org">
42 + <string>xwiki</string>
43 + </list>
44 + </value>
45 + </property>
46 +</jobRequest>
47 +

Get Connected