Changes for page REST API

Last modified by Thomas Mortagne on 2024/03/12

<
From version < 41.1 >
edited by Thomas Mortagne
on 2014/11/21
To version < 46.1 >
edited by Guillaume Delhumeau
on 2015/08/26
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.ThomasMortagne
1 +XWiki.gdelhumeau
Content
... ... @@ -255,7 +255,9 @@
255 255  * **HTTP Method:** GET
256 256  ** **Media types:**
257 257  *** application/xml (SearchResults element)
258 -** **Description:** Search resources (pages and attachments) 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. If //className// is specified, the result will also contain the data for the first object of the corresponding class.
258 +** **Description:** Search resources (pages and attachments):
259 +*** [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. If //className// is specified, the result will also contain the data for the first object of the corresponding class.
260 +*** [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. If //className// is specified, the result will also contain the data for the first object of the corresponding class.
259 259  ** **Status codes:**
260 260  *** 200: If the request was successful.
261 261  
... ... @@ -294,7 +294,7 @@
294 294  * **HTTP Method:** GET
295 295  ** **Media types:**
296 296  *** application/xml (SearchResults element)
297 -** **Description:** Allow to execute HQL, XWQL or Lucene 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]] and [[Lucene Plugin>>extensions:Extension.Lucene Plugin]] examples of the queries that can be specified in this parameter. If //className// is specified, the result will also contain the data for the first object of the corresponding class.
299 +** **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 //className// is specified, the result will also contain the data for the first object of the corresponding class.
298 298  ** **Status codes:**
299 299  *** 200: If the request was successful.
300 300  
... ... @@ -323,7 +323,7 @@
323 323  ** **Status codes:**
324 324  *** 200: If the request was successful.
325 325  
326 -=== /wikis/{wikiName}/spaces/{spaceName}/search?q~={keywords}~[~[&scope~={name,content,title,objects}...]&number~=n] ===
328 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/search?q~={keywords}~[~[&scope~={name,content,title,objects}...]&number~=n] ===
327 327  
328 328  * **HTTP Method:** GET
329 329  ** **Media types:**
... ... @@ -335,7 +335,7 @@
335 335  
336 336  == Page resources ==
337 337  
338 -=== /wikis/{wikiName}/spaces/{spaceName}/pages[?start~=offset&number~=n] ===
340 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages[?start~=offset&number~=n] ===
339 339  
340 340  * **HTTP Method:** GET
341 341  ** **Media types:**
... ... @@ -345,7 +345,7 @@
345 345  *** 200: If the request was successful.
346 346  *** 401: If the user is not authorized.
347 347  
348 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName} ===
350 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName} ===
349 349  
350 350  * **HTTP Method:** GET
351 351  ** **Media types:**
... ... @@ -381,7 +381,7 @@
381 381  *** 204: If the request was successful.
382 382  *** 401: If the user is not authorized.
383 383  
384 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history[?start~=offset&number~=n] ===
386 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history[?start~=offset&number~=n] ===
385 385  
386 386  * **HTTP Method:** GET
387 387  ** **Media types:**
... ... @@ -391,7 +391,7 @@
391 391  *** 200: If the request was successful.
392 392  *** 401: If the user is not authorized.
393 393  
394 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version} ===
396 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version} ===
395 395  
396 396  * **HTTP Method:** GET
397 397  ** **Media types:**
... ... @@ -401,7 +401,7 @@
401 401  *** 200: If the request was successful.
402 402  *** 401: If the user is not authorized.
403 403  
404 -==== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations[?start~=offset&number~=n] ====
406 +==== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations[?start~=offset&number~=n] ====
405 405  
406 406  * **HTTP Method:** GET
407 407  ** **Media types:**
... ... @@ -411,7 +411,7 @@
411 411  *** 200: If the request was successful.
412 412  *** 401: If the user is not authorized.
413 413  
414 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{language} ===
416 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations/{language} ===
415 415  
416 416  * **HTTP Method:** GET
417 417  ** **Media types:**
... ... @@ -447,7 +447,7 @@
447 447  *** 204: If the request was successful.
448 448  *** 401: If the user is not authorized.
449 449  
450 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{language}/history ===
452 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations/{language}/history ===
451 451  
452 452  * **HTTP Method:** GET
453 453  ** **Media types:**
... ... @@ -457,7 +457,7 @@
457 457  *** 200: If the request was successful.
458 458  *** 401: If the user is not authorized.
459 459  
460 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/translations/{lang}/history/{version} ===
462 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/translations/{lang}/history/{version} ===
461 461  
462 462  * **HTTP Method:** GET
463 463  ** **Media types:**
... ... @@ -467,7 +467,7 @@
467 467  *** 200: If the request was successful.
468 468  *** 401: If the user is not authorized.
469 469  
470 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/children ===
472 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/children ===
471 471  
472 472  * **HTTP Method:** GET
473 473  ** **Media types:**
... ... @@ -489,7 +489,7 @@
489 489  
490 490  == Tag resources ==
491 491  
492 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/tags ===
494 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/tags ===
493 493  
494 494  * **HTTP Method:** GET
495 495  ** **Media types:**
... ... @@ -535,7 +535,7 @@
535 535  
536 536  == Comments resources ==
537 537  
538 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/comments[?start~=offset&number~=n] ===
540 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/comments[?start~=offset&number~=n] ===
539 539  
540 540  * **HTTP Method:** GET
541 541  ** **Media types:**
... ... @@ -559,7 +559,7 @@
559 559  *** 201: If the comment was created. (The Location header will contain the URI where the comment has been created.)
560 560  *** 401: If the user is not authorized.
561 561  
562 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/comments/{commentId} ===
564 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/comments/{commentId} ===
563 563  
564 564  * **HTTP Method:** GET
565 565  ** **Media types:**
... ... @@ -569,7 +569,7 @@
569 569  *** 200: If the request was successful.
570 570  *** 401: If the user is not authorized.
571 571  
572 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/comments ===
574 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/comments ===
573 573  
574 574  * **HTTP Method:** GET
575 575  ** **Media types:**
... ... @@ -579,7 +579,7 @@
579 579  *** 200: If the request was successful.
580 580  *** 401: If the user is not authorized.
581 581  
582 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/comments/{commentId} ===
584 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/comments/{commentId} ===
583 583  
584 584  * **HTTP Method:** GET
585 585  ** **Media types:**
... ... @@ -591,7 +591,7 @@
591 591  
592 592  == Attachments resources ==
593 593  
594 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments[?start~=offset&number~=n] ===
596 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments[?start~=offset&number~=n] ===
595 595  
596 596  * **HTTP Method:** GET
597 597  ** **Media types:**
... ... @@ -601,7 +601,7 @@
601 601  *** 200: If the request was successful.
602 602  *** 401: If the user is not authorized.
603 603  
604 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName} ===
606 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments/{attachmentName} ===
605 605  
606 606  * **HTTP Method:** GET
607 607  ** **Media types:**
... ... @@ -633,7 +633,7 @@
633 633  *** 204: If the attachment was deleted.
634 634  *** 401: If the user is not authorized.
635 635  
636 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/attachments[?start~=offset&number~=n] ===
638 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/attachments[?start~=offset&number~=n] ===
637 637  
638 638  * **HTTP Method:** GET
639 639  ** **Media types:**
... ... @@ -643,7 +643,7 @@
643 643  *** 200: If the request was successful.
644 644  *** 401: If the user is not authorized.
645 645  
646 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/attachments/{attachmentName} ===
648 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/attachments/{attachmentName} ===
647 647  
648 648  * **HTTP Method:** GET
649 649  ** **Media types:**
... ... @@ -653,7 +653,7 @@
653 653  *** 200: If the request was successful.
654 654  *** 401: If the user is not authorized.
655 655  
656 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName}/history ===
658 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments/{attachmentName}/history ===
657 657  
658 658  * **HTTP Method:** GET
659 659  ** **Media types:**
... ... @@ -663,7 +663,7 @@
663 663  *** 200: If the request was successful.
664 664  *** 401: If the user is not authorized.
665 665  
666 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/attachments/{attachmentName}/history/{version} ===
668 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/attachments/{attachmentName}/history/{version} ===
667 667  
668 668  * **HTTP Method:** GET
669 669  ** **Media types:**
... ... @@ -673,7 +673,7 @@
673 673  *** 200: If the request was successful.
674 674  *** 401: If the user is not authorized.
675 675  
676 -=== /wikis/{wikiName}/spaces/{spaceName}/attachments[?name~=attachmentName&page~=pageName&author~=authorName&types~=attachmentTypeList&start~=offset&number~=n] ===
678 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/attachments[?name~=attachmentName&page~=pageName&author~=authorName&types~=attachmentTypeList&start~=offset&number~=n] ===
677 677  
678 678  * **HTTP Method:** GET
679 679  ** **Media types:**
... ... @@ -695,7 +695,7 @@
695 695  
696 696  == Object resources ==
697 697  
698 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects[?start~=offset&number~=n] ===
700 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects[?start~=offset&number~=n] ===
699 699  
700 700  * **HTTP Method:** GET
701 701  ** **Media types:**
... ... @@ -718,7 +718,7 @@
718 718  *** 201: If the object was created (The Location header will contain the URI associated to the newly created object).
719 719  *** 401: If the user is not authorized.
720 720  
721 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}[?start~=offset&number~=n] ===
723 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}[?start~=offset&number~=n] ===
722 722  
723 723  * **HTTP Method:** GET
724 724  ** **Media types:**
... ... @@ -728,7 +728,7 @@
728 728  *** 200: If the request was successful.
729 729  *** 401: If the user is not authorized.
730 730  
731 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber} ===
733 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}/{objectNumber} ===
732 732  
733 733  * **HTTP Method:** GET
734 734  ** **Media types:**
... ... @@ -760,7 +760,7 @@
760 760  *** 204: If the object was deleted.
761 761  *** 401: If the user is not authorized.
762 762  
763 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber}/properties ===
765 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}/{objectNumber}/properties ===
764 764  
765 765  * **HTTP Method:** GET
766 766  ** **Media types:**
... ... @@ -770,7 +770,7 @@
770 770  *** 200: If the request was successful.
771 771  *** 401: If the user is not authorized.
772 772  
773 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/objects/{className}/{objectNumber}/properties/{propertyName} ===
775 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/objects/{className}/{objectNumber}/properties/{propertyName} ===
774 774  
775 775  * **HTTP Method:** GET
776 776  ** **Media types:**
... ... @@ -794,7 +794,7 @@
794 794  *** 202: If the object was updated.
795 795  *** 401: If the user is not authorized.
796 796  
797 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects[?start~=offset&number~=n] ===
799 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects[?start~=offset&number~=n] ===
798 798  
799 799  * **HTTP Method:** GET
800 800  ** **Media types:**
... ... @@ -804,7 +804,7 @@
804 804  *** 200: If the request was successful.
805 805  *** 401: If the user is not authorized.
806 806  
807 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber} ===
809 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects/{className}/{objectNumber} ===
808 808  
809 809  * **HTTP Method:** GET
810 810  ** **Media types:**
... ... @@ -814,7 +814,7 @@
814 814  *** 200: If the request was successful.
815 815  *** 401: If the user is not authorized.
816 816  
817 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties ===
819 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties ===
818 818  
819 819  * **HTTP Method:** GET
820 820  ** **Media types:**
... ... @@ -824,7 +824,7 @@
824 824  *** 200: If the request was successful.
825 825  *** 401: If the user is not authorized.
826 826  
827 -=== /wikis/{wikiName}/spaces/{spaceName}/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties/{propertyName} ===
829 +=== /wikis/{wikiName}/spaces/{spaceName}[/spaces/{nestedSpaceName}]*/pages/{pageName}/history/{version}/objects/{className}/{objectNumber}/properties/{propertyName} ===
828 828  
829 829  * **HTTP Method:** GET
830 830  ** **Media types:**
... ... @@ -886,6 +886,30 @@
886 886  *** 200: If the request was successful.
887 887  *** 401: If the user is not authorized.
888 888  
891 +== Job resources ==
892 +
893 +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##).
894 +
895 +=== /jobstatus/{jobId} ===
896 +
897 +* **HTTP Method:** GET
898 +** **Media types:**
899 +*** application/xml (JobStatus element)
900 +** **Description:** status of a job
901 +** **Status codes:**
902 +*** 200: If the request was successful.
903 +*** 404: If the job status has not been found
904 +
905 +=== /joblog/{jobId}[?level~={error,warn,info,debug,trace}&fromLevel~={error,warn,info,debug,trace}] ===
906 +
907 +* **HTTP Method:** GET
908 +** **Media types:**
909 +*** application/xml (JobLog element)
910 +** **Description:** log of a job
911 +** **Status codes:**
912 +*** 200: If the request was successful.
913 +*** 404: If the job status has not been found
914 +
889 889  == Other resources ==
890 890  
891 891  === /wikis/{wikiName}/modifications[?start~=offset&number~=n&date~=t] ===
... ... @@ -937,6 +937,21 @@
937 937  
938 938  The xwiki-platform-rest-api module can be also seen as an authoritative reference for the REST API.
939 939  
966 += Generate a REST URL for a resource =
967 +
968 +If you need to generate a REST URL for a resource inside a script, you can use the REST script services:
969 +
970 +{{code language="velocity"}}
971 +$services.rest.url($entityReference)
972 +{{/code}}
973 +
974 +Where ##$entityReference## could be:
975 +
976 +* a ##DocumentReference##
977 +* a ##SpaceReference##
978 +
979 +We plan to add more supported entities in the future (ObjectReference, ClassReference, etc...).
980 +
940 940  = Using the RESTful API =
941 941  
942 942  == Highlevel description and tutorial for a basic usage of the RESTful API ==

Get Connected