public. Update contents of a page
| Name | Type | Description |
| pageid | string | either an integer page ID, "home", or "=" followed by a double uri-encoded page title |
| Name | Type | Description |
| abort | {never, modified, exists}? | specifies condition under which to prevent the save; default is never |
| authenticate | bool? | Force authentication for request (default: false) |
| comment | string? | the edit comment |
| edittime | string | the edit timestamp (yyyyMMddHHmmss or yyyy-MM-ddTHH:mm:ssZ) |
| importtime | string? | If this is an import, the edit timestamp of the imported content (yyyyMMddHHmmss or yyyy-MM-ddTHH:mm:ssZ) |
| language | string? | the page language (default: determine culture from parent) |
| overwrite | bool? | New page revision is created when no changes are detected when overwrite is true (default: false) |
| redirects | int? | If zero, do not follow page redirects. |
| relto | int? | Page used for path normalization (default: none) |
| reltopath | string? | Page used for path normalization. Ignored if relto parameter is defined. (default: none) |
| section | int? | the section number. If zero, append as a new section |
| tidy | {remove, convert}? | Determines if invalid content is converted to text or removed (default: 'convert') |
| title | string? | the display title (default: use existing title or determine from page path.) |
| xpath | string? | identifies the portion of the page to update; this parameter is ignored if section is specified |
| Name | Value | Description |
| BadRequest | 400 | Invalid input parameter or request body |
| Forbidden | 403 | Update access to the page is required |
| NotFound | 404 | Requested page could not be found |
| Ok | 200 | The request completed successfully |
Input:
Content-type=text/plain
Output:
<edit status="{success|conflict}">
<page id="{int}" href="{uri}">
<title>{text}</title>
<path>{text}</path>
</page>
<page.base id="{int}" revision="{int}" href="{uri}">
<title>{text}</title>
<path>{text}</path>
<date.edited>{date}</date.edited>
<user.author id="{int}" href="{uri}">
<nick>{text}</nick>
<username>{text}</username>
<email>{text}</email>
</user.author>
<description>{text}</description>
<contents type="{contenttype}" href="{uri}" />
</page.base>
<page.overwritten id="{int}" revision="{int}" href="{uri}">
<title>{text}</title>
<path>{text}</path>
<date.edited>{date}</date.edited>
<user.author id="{int}" href="{uri}">
<nick>{text}</nick>
<username>{text}</username>
<email>{text}</email>
</user.author>
<description>{text}</description>
<contents type="{contenttype}" href="{uri}" />
</page.overwritten>
</edit>
If the page does not exist, a new page is created. Otherwise, the existing page is updated.
Use the Abort parameter to control edit conflict behavior. Abort=exists specifies that the save should abort if the page already exists. Similarly, Abort=modified specifies that the save should abort if the page has been modified since the Edittime parameter. Abort=never always allows the save to occur; the system makes no attempt to merge edit conflicts and simply overwrites the existing content. If an edit conflict is detected (ie. someone else edited the page since the value specified in the Edittime parameter), the edit status is set to "conflict" and the page.base/page.overwritten elements are populated. The page.base element displays the revision upon which the changes in the current save were based. The page.overwritten element displays the page revision containing the overwritten content.
It is possible to update a portion of an existing page using either the Section or XPath parameters. The Section parameter contains the integer section number to update. Everything within the specified section is replaced, including the section heading itself. Section=0 specifies to append the new content to the end of the document. The XPath parameter identifies a document node to replace. Refer here for more information on XPath syntax.
The edittime parameter has to be supplied when updating a page!
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by
UPDATE - Looks to be yyyymmddhhmmss. (And use UTC time, not local time.) edited 06:51, 2 Jul 2008
Note that a bug in 8.08 and below has that returning a local time, rather than UTC.
But you can set it to sometime in the future to enforce the overwrite (thanks, Bjorg!) edited 10:02, 25 Feb 2009
http://developer.mindtouch.com/en/ref/dream/MindTouch.Dream/XUri/DoubleEncodeSegment
See the C# example for more information.