API:Edit

Edit
Edit action allows to modify existing articles on MediaWiki Server or create new ones. As in the previous operations, most parameters are passed via POST. It is important to remark that edit action is a two-steps operation. That is, it is necessary to execute an action=query to obtain previously the edittoken, essential to perform commit operations on the database, associated with the execution of the method save of ApiEdit.php.

Sample request and response:

Request:

In a previous step: http://en.wikipedia.org/w/api.php?action=query&prop=info&titles=Zaragoza&intoken=edit

Response:  

Request: api.php ? action=edit & eptitle=”Title_Article” Post parameters: epedittoken=abc123		 Obtained from the previous query action. epsummary=editSummary          Summary of changes eptext=WikiText		 Article content [ lgtoken] = 123abc		 ''Token identifying the user editing the article. For non-anonymous users.'' [ minoredit = yes/no ]	 Optional check-box indicating minor changes. [ disablemerge=yes/no ]	 Optional check-box indicating merge is disabled [ testrun = yes/no ]		 Optional check-box [ epuserid = userId ]          Parameter identifying the logged user uploading the file [ epedittime = Revision time ] ''Time indicating the moment when a revision is going to be editted. It is used to verify an'' ''article has been modified meanwhile other user was editing it. In that case, the server'' will try to merge the contents. Response: result: Success		 Other values: UserNotLogged, UserBlocked, ReadOnlyArticle,UserConfirmEmail, NoCreatePermission, ReadOnlyMode, Prohibited, DbLocked title:”Main Page”		 Normalized title id: 12345			 On success, the ID of the page revid: 6789			 On success, the new latest revision id content=”wikiText”		 When used with testrun, this field will be set to the merge result