Hi Brad, Roan,
Thanks for the quick reply. I, as a matter of fact, did not enable it. I
just went ahead and researched the config settings I should have in
LocalSettings.php and added these two:
$wgEnableWriteAPI = true;
$wgEnableAPI = true;
Besides that I noticed that one of my links, as Roan suggested, was missing
action=edit or rather it was there but I had a double ? ie.
index.php?format=xml?action=. How silly of me.
I'm now getting this, which I'll work through in a bit as I might have an
idea of what it is:
Array
(
[error] => Array
(
[code] => notext
[info] => One of the text, appendtext and prependtext
parameters must be set
)
)
I did notice that the API enable option isn't described at all in the API
reference manual. That's probably something people should know before trying
to do editing and similar things. Unless I missed it (which tends to happen
to me :-p).
Thanks and cheers,
Dave
On Wed, Jan 14, 2009 at 4:03 PM, Roan Kattouw <roan.kattouw(a)home.nl> wrote:
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)
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api