Hi,
I am trying to update/create articles on our Wiki using the mediawiki API (using last version found on http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/api)
Login phase (action=login) works correctly and returns <LoginToken> and <LoginUserId> information.
Then I try to retrieve the token of one page using query action with following parameters: <WIKIURL>/api.php?action=query&titles=<PageName>&prop=info&intoken=edit&lgtoken=<LoginToken>&lgusername=<MyLogin>&lguserid=<LoginUserId>
Unfortunatelly, I always get the following response (xml format), what ever the login used (even if user has Sysopt rights): <?xml version="1.0" encoding="utf-8"?><api><error code="inpermissiondenied" info="Action 'edit' is not allowed for the current user" /></api>
I don't understand this error and don't find documentation about it. Do I need to configure a specific parameter on Wiki to allow "edit" ?
Thanks for your help.
Marion Leclerc
marion.leclerc@orange-ftgroup.com schreef:
Then I try to retrieve the token of one page using query action with following parameters: <WIKIURL>/api.php?action=query&titles=<PageName>&prop=info&intoken=edit&lgtoken=<LoginToken>&lgusername=<MyLogin>&lguserid=<LoginUserId>
You used the lg* parameters to stay logged in, which isn't possible any more due to security concerns. The docs hadn't been updated yet, I did so upon seeing your e-mail. The correct way to stay logged in is to fetch the cookies from the action=login request and pass them back to all subsequent requests. An example of how to do this in PHP using Snoopy is linked to from the External links section of the login documentation [1].
Roan Kattouw (Catrope)
mediawiki-api@lists.wikimedia.org