I'm following the following help page, in order to receive an edit token (I'm using MW 1.14.0): http://www.mediawiki.org/wiki/API:Edit_-_Create%26Edit_pages
It tells to use the Url on the following form: api.php?action=query&prop=info|revisions&intoken=edit&titles=Main%20Page
But that gives me the following error:
<?xml version="1.0"?> <api> <error code="unknown_action" info="Unrecognized value for parameter 'action': query">
I've tried to execute the query with both GET (directly in the browser) and POST (via Curl in PHP) with the same result. Have also tried the following combinations with the same result: api.php?action=query&prop=info|revisions and api.php?action=query
Am I doing anything wrong, or is this the correct way to get an edit token?
Regards Samuel Lampa http://www.rilnet.com
Well, it all was due to a user rights setting in LocalSettings.php: $wgGroupPermissions['*' ]['read'] = false;
Since I want to keep this setting, is it possible to enable access to the API only though settings in LocalSettings.php? The following did not help: $wgGroupPermissions['*']['writeapi'] = true;
// Samuel
Samuel Lampa skrev:
I'm following the following help page, in order to receive an edit token (I'm using MW 1.14.0): http://www.mediawiki.org/wiki/API:Edit_-_Create%26Edit_pages
It tells to use the Url on the following form: api.php?action=query&prop=info|revisions&intoken=edit&titles=Main%20Page
But that gives me the following error:
<?xml version="1.0"?>
<api> <error code="unknown_action" info="Unrecognized value for parameter 'action': query">
I've tried to execute the query with both GET (directly in the browser) and POST (via Curl in PHP) with the same result. Have also tried the following combinations with the same result: api.php?action=query&prop=info|revisions and api.php?action=query
Am I doing anything wrong, or is this the correct way to get an edit token?
Regards Samuel Lampa http://www.rilnet.com
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Samuel Lampa skrev:
Since I want to keep this setting, is it possible to enable access to the API only though settings in LocalSettings.php? The following did not help: $wgGroupPermissions['*']['writeapi'] = true;
Well, this is not really needed anymore either, since I now managed to log in through the API.
First I had problems doing that. My major obstacle was how to store the cookie when connecting through cURL/PHP, but that was solved by using the cURL class posted at http://www.php.net/manual/en/book.curl.php#86391 , which takes care of cookies et.c.
// Samuel
2009/4/1 Samuel Lampa samuel.lampa.l@rilnet.com:
Samuel Lampa skrev:
Since I want to keep this setting, is it possible to enable access to the API only though settings in LocalSettings.php? The following did not help: $wgGroupPermissions['*']['writeapi'] = true;
Well, this is not really needed anymore either, since I now managed to log in through the API.
You're correctly pointing out that acting like action=query doesn't exist to users who don't have permission to use it is confusing and wrong. This has been fixed on trunk, which means it shouldn't be happening on Wikipedia anymore and won't happen in MW 1.15+.
Roan Kattouw (Catrope)
Roan Kattouw skrev:
2009/4/1 Samuel Lampa samuel.lampa.l@rilnet.com:
Samuel Lampa skrev:
Since I want to keep this setting, is it possible to enable access to the API only though settings in LocalSettings.php? The following did not help: $wgGroupPermissions['*']['writeapi'] = true;
Well, this is not really needed anymore either, since I now managed to log in through the API.
You're correctly pointing out that acting like action=query doesn't exist to users who don't have permission to use it is confusing and wrong. This has been fixed on trunk, which means it shouldn't be happening on Wikipedia anymore and won't happen in MW 1.15+.
Ok, thanks for the information!
// Samuel
mediawiki-api@lists.wikimedia.org