David Di Biase schreef:
Hi there,
I just started using the MediaWiki API today. I'm writting a script to
insert about 500 new articles into the Wiki. I'm using PHP5, MedaWiki
1.13.3.
I've decided to use CURL to communicate with the APIs on my local machine.
So far I can login, receive my lgtoken and request an edit token - which is
all good. What I'm noticing however is when I use the examples on the site
to send an action=edit I get this returned back:
Array
(
[error] => Array
(
[code] => help
[info] =>
[*] =>
Plus the entire manual after it. What's even more strange is when I read the
the manual more closely I don't see any references to action=edit being
available. I have however found the same manual on other sites which list it
accordingly. I'm completely baffled. Apparently 1.13.3 *does* have support
for API editing.
The reason you don't see action=edit in the manual is probably
because
you've got editing disabled for anonymous users, or because the write
API is disabled on your wiki. In the former case, verify you're properly
logged in by checking meta=userinfo. In the latter case, set
$wgEnableWriteAPI = true; in LocalSettings.php . In either case, you
should be getting something like this:
Array
(
[error] => Array
(
[code] => unknown_action
[info] => Unrecognized value for parameter 'action': edit
)
)
A response with code=help and the help text included (even in a non-fm
format) suggests you're using action=help or no action at all.
Roan Kattouw (Catrope)