HTTP Verb: POST

Available statuses: 201 Created, 404 Not Found, 422 Unprocessable Entity

Object: WikiPage

Location: available

Formats: XML, JSON

Create a wiki page.

Params

To create a wiki page, a data body must be provided. Data can be provided in three formats: XML, JSON and query string. To specify data type of XML or JSON add the Content-type: application/(json|xml) header to request headers. If you want to provide query string simply skip the Content-type header.

All params should be sent in the wiki-page namespace, e.g.:

XML

<wiki-page>
  <page-name>Page Name</page-name>
  <contents>Page contents</contents>
  ...
</wiki-page>

JSON

{"wiki_page":{"page_name":"Page Name","contents":"Page contents",...}}

Query string

wiki_page[page_name]=Page Name&wiki_page[contents]=Page contents...

Check the full list of available params on wiki page object fields reference

Examples

For example purposes we use a JSON body

{"wiki_page":{"page_name":"Page Name","contents":"Page contents"}}

Request XML, using cURL utility:

curl -i -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"wiki_page":{"page_name":"Page Name","contents":"Page contents"}}' https://api.assembla.com/v1/spaces/_space_id/wiki_pages.xml

Response:

HTTP/1.1 201 Created
Server: nginx/0.8.55
Date: Fri, 07 Sep 2012 13:08:42 GMT
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 201
Location: https://api.assembla.com/v1/spaces/_space_id/wiki_pages/Page_Name
...

<?xml version="1.0" encoding="UTF-8"?>
<wiki-page>
  <contents>Page contents</contents>
  <status type="integer">1</status>
  <change-comment nil="true">
  </change-comment>
  <page-name>Page_Name</page-name>
  <wiki-format type="integer">3</wiki-format>
  <created-at type="datetime">2012-12-05T06:07:57Z</created-at>
  <parent-id>deSYH2o5Cr4Qc75bfBjDYC</parent-id>
  <position type="integer">1</position>
  <updated-at type="datetime">2012-12-05T08:44:36Z</updated-at>
  <user-id>cpDo7CoOOr4Orf5bfBjDYC</user-id>
  <id>aDsOUopQir4Psa5bfBjDYC</id>
  <space-id>cVXMqIoOOr4Orf5bfBjDYC</space-id>
  <version type="integer">1</version>
</wiki-page>

Request JSON, using cURL utility:

curl -i -H "Authorization: Bearer _token" -H "Content-type: application/json" -d '{"wiki_page":{"page_name":"Page Name","contents":"Page contents"}}' https://api.assembla.com/v1/spaces/_space_id/wiki_pages.json

Response:

HTTP/1.1 201 Created
Server: nginx/0.8.55
Date: Fri, 07 Sep 2012 13:12:30 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 201
Location: https://api.assembla.com/v1/spaces/_space_id/wiki_pages/Page_Name
...

{
  "contents": "Page contents",
  "status": 1,
  "change_comment": null,
  "page_name": "Page_Name",
  "wiki_format": 3,
  "created_at": "2012-12-04T22:07:57-08:00",
  "parent_id": "deSYH2o5Cr4Qc75bfBjDYC",
  "position": 1,
  "updated_at": "2012-12-05T00:44:36-08:00",
  "user_id": "cpDo7CoOOr4Orf5bfBjDYC",
  "id": "aDsOUopQir4Psa5bfBjDYC",
  "space_id": "cVXMqIoOOr4Orf5bfBjDYC",
  "version": 1
}

JSON is formatted here for readability, in a real response JSON body is inline with no indentation.

Description for each field: wiki page object fields reference