HTTP Verb: PUT

Available statuses: 200 OK, 404 Not Found, 422 Unprocessable Entity

Object: WikiPage

Location: n/a

Formats: XML, JSON

Update a wiki page.

Params

To update 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>New Page Name</page-name>
  ...
</wiki-page>

JSON

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

Query string

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

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":"New Page Name"}}

Request XML, using cURL utility:

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

Response:

HTTP/1.1 200 OK
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: 200
...

Request JSON, using cURL utility:

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

Response:

HTTP/1.1 200 OK
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: 200
...

{}

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