Rest WikiPages » History » Version 1

Version 1/6 - Next » - Current version
Jean-Philippe Lang, 2012-10-25 23:33


Wiki Pages

Getting the pages list of a wiki

GET /projects/foo/wiki/index.xml

Returns the list of all pages in a project wiki.

Response:

<?xml version="1.0"?>
<wiki_pages type="array">
  <wiki_page>
    <title>UsersGuide</title>
    <version>2</version>
    <created_on>2008-03-09T12:07:08Z</created_on>
    <updated_on>2008-03-09T23:41:33+01:00</updated_on>
  </wiki_page>
  ...
</wiki_pages>

Getting a wiki page

GET /projects/foo/wiki/UsersGuide.xml

Returns the details of a wiki page.

Includable:
  • attachments

Response:

<?xml version="1.0"?>
<wiki_page>
  <title>UsersGuide</title>
  <parent title="Installation_Guide"/>
  <text>h1. Users Guide
  ...
  ...</text>
  <version>22</version>
  <author id="11" name="John Smith"/>
  <comments>Typo</comments>
  <created_on>2009-05-18T20:11:52Z</created_on>
  <updated_on>2012-10-02T11:38:18Z</updated_on>
</wiki_page>

Creating or updating a wiki page

PUT /projects/foo/wiki/UsersGuide.xml
<?xml version="1.0"?>
<wiki_page>
  <text>Example</text>
  <comments>Typo</comments>
</issue>

Creates or updates a wiki page.

When updating an existing page, you can include a version attribute to make sure that the page is a specific version when you try to update it (eg. you don't want to overwrite an update that would have been done after you retrieved the page). Example:

PUT /projects/foo/wiki/UsersGuide.xml
<?xml version="1.0"?>
<wiki_page>
  <text>Example</text>
  <comments>Typo</comments>
  <version>18</version>
</issue>

This would update the page if its current version is 18, otherwise a 409 Conflict error is returned.

Response:
  • 200 OK: page was updated
  • 201 Created: page was created
  • 409 Conflict: occurs when trying to update a stale page (see above)
  • 422 Unprocessable Entity: page was not saved due to validation failures (response body contains the error messages)