API:Edit

Token
To edit a page, an edit token is required. This token is the same for all pages, but changes at every login. If you want to protect against edit conflicts (which is wise), you also need to get the timestamp of the last revision. You can obtain these as follows:

Editing pages
Pages can be moved with action=edit.

Parameters

 * : Page to edit
 * : Section to edit. Use 0 for the top section, 'new' for a new section
 * : New page (or section) content
 * : Edit token
 * : Edit comment
 * When using, this will be used for the section title
 * : If set, mark the edit as minor
 * : If set, don't mark the edit as minor, even if you have the "Mark all my edits minor by default" preference enabled
 * : If set, mark the edit as bot
 * : Timestamp of the last revision, used to detect edit conflicts. Leave unset to ignore conflicts
 * : If set, suppress errors about the page having been deleted in the meantime and recreate it
 * : If set, throw an error if the page already exists
 * : Add the page to your watchlist
 * : Remove the page from your watchlist, or don't add it even though you have a preference like "Automatically watch all pages I edit" enabled
 * : CAPTCHA ID from the previous request
 * : Answer to the CAPTCHA

Sample request
TODO

Possible errors
All errors are formatted as:


 * code: nofrom
 * info: The from parameter must be set
 * code: noto
 * info: The to parameter must be set
 * code: notoken
 * info: The token parameter must be set
 * code: badtoken
 * info: Invalid token
 * code: permissiondenied
 * info: You don't have permission to move "oldtitle  to "newtitle 
 * This can mean that you either don't have permission to move at all, or that the page in question is protected
 * code: blocked
 * info: You have been blocked from editing
 * code: readonly
 * info: The wiki is in read-only mode
 * In read-only mode, absolutely nothing can be changed.
 * code: nosuppress
 * info: You don't have permission to suppress redirect creation
 * By default, this is limited to sysops and bots, but other wikis may have different settings
 * code: invalidtitle
 * info: bad title "title ''
 * This means title contains invalid characters or is blank. Note that titles like Talk: and User: are also considered blank.
 * code: missingtitle
 * info: "title '' doesn't exist
 * code: selfmove
 * info: Can't move "title '' to itself
 * code: immobilenamespace-from
 * info: Pages in the "fromnamespace '' namespace can't be moved
 * code: immobilenamespace-to
 * info: Pages in the "tonamespace '' namespace can't be moved
 * code: targetexists
 * info: "newtitle  already exists and is not a redirect to "oldtitle 

NOTE: If moving the page itself succeeded, but moving the talk page failed, the relevant error will be returned in the talkmove-error-code and talkmove-error-info fields. The possible error codes in this case are immobilenamespace-from, immobilenamespace-to, targetexists, permissiondenied and unknownerror ("Unknown error "errorcode '' ")