API:Changing wiki content

Current Efforts
The API edit functionality has not yet been implemented, but work is being done in two branches:
 * apiedit - page (un)deletion and (un)protection and moving and user (un)blocking.
 * ApiEdit_Vodafone - page editing, image upload, new account registration.

Please see appropriate subsection for detailed information for each feature.
 * Edit about the action to create new articles or modify existing ones.
 * Move about the action to rename or move articles.
 * Upload about the action to upload files to MediaWiki software like image, audio, video.
 * RegUser about the action to create new user accounts.
 * Rollback about the action to rollback the last series of contributions to a page.
 * Delete about the action to delete existing articles.
 * Undelete about the actions to view and restore deleted revisions.
 * Protect about the actions to change the protection levels for a page.
 * Block about the actions to block and unblock a user.
 * Groups about the actions to add a user to or remove them from one or more groups.

Posting Data / needs major editPage.php rewrite
 this feature depends on the query token, which is NOT implemented  Need Help At present, user interface code is tightly woven with the database access code, making it unusable for the API. These two must be separated from one another – we need a clean data access layer without any UI logic. If you want to contribute with rewriting EditPage.php, and if you know PHP and MediaWiki, or you think you can learn it, please give us a hand at making this possible. --Yurik 15:07, 17 October 2006 (UTC)

action=submit allows data to be posted back to the MediaWiki servers. For this to work, the client must first obtain an edittoken by using prop=info & intoken=edit query call. Both the lastrev and the token have to be sent to the server, together with the title of the page, its content, and the summary comment. disablemerge parameter stops the save operation in case the article has been modified after the query call. testrun parameter attempts the save operation by merging the content with the newer changes (if needed), and returning how the page would look like if it was saved, but without actually changing any data.

Note: The parameters should be modified to allow for the controlled merge. For example: rev #1 is received, an attempt is made to save changes to it, but rev #2 has been created in the meantime. The client decides to allow merge with rev #2, but while the decision is made, the rev #3 has been published. The client should have the option to only allow merging with rev #2 which was verified, not with rev#3 that it has not yet seen.

Request: api.php ? action=submit & title=Project:articleA & edittoken=abc123 & revid=12345 & summary=edit_comment & content=wikitext [& minorEdit] [& disablemerge] [& testrun] Result: api: save: status: Success            Other values: 'Prohibited', 'Conflict', 'DbLocked', 'BadToken', 'MergeRequired' (for the testrun: 'CanMerge', 'CanSaveAsIs'       title: Wikipedia:ArticleA   Always returns normalized title       ns: 4                       Show title's namespace except when ns=0       id: 12345                   On success, the ID of the page       revid: 67891                On success, the new latest revision id       redirect:                   On success, when saved page is now treated as a redirect       content: wiki content       When used with testrun'', this field will be set to the merge result