Same problem happens in 1.13. (I'm using 1.12 below.)
DanB
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Daniel Barrett Sent: Wednesday, May 21, 2008 11:00 AM To: MediaWiki announcements and site admin list Subject: [Mediawiki-l] MediaWiki API help: cannot get a token after login
I'm trying out the MediaWiki API and cannot seem to obtain a token (say, a "move" token) after a successful login. Can anyone help? Here is what I've tried. This is MediaWiki 1.12.0 on Windows 2003 Server (Apache 2.2.8, MySQL 5, PHP 5.2.5).
I do have:
$wgEnableWriteAPI = true;
My script runs on the command line. Login succeeds, giving me a login token, when I POST with these parameters:
api.php?action=login&lgname=tester&lgpassword=123456&format=xml
and get back:
<?xml version="1.0" encoding="utf-8"?> <api> <login result="Success" lguserid="123" lgusername="tester" lgtoken="eedcad0fa714033528290183da251af8" cookieprefix="wikidb_mw_" sessionid="lldh5t86b3vbeccpeda46s5ep6" /> </api>
But when I try to get a Move token via POST:
api.php?action=query&prop=info&intoken=move&titles=my+new+page&lgtoken=eedcad0fa714033528290183da251af8&format=xml
I get:
<?xml version="1.0" encoding="utf-8"?> <api> <error code="inpermissiondenied" info="Action 'move' is not allowed for the current user" /> </api>
Strangely, if I paste the "move token" URL into a web browser, instead of running a script on the command line, I get different results:
<api> <query> <normalized> <n from="my new page" to="My new page"/> </normalized> <pages> <page ns="0" title="My new page" missing=""/> </pages> </query> </api>
but still no Move token.
Any ideas? Thanks! DanB
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l