Hi,

 

I am getting an issue using the edit action of the MediaWiki API. Whenever I send an edit request I am getting an error response stating badtoken. The question I have is which token is this referring to. Is this referring to my cookie token which I have instructed curl to store or is it referring to the edit token.

 

The login operation is given the following parameters using a POST request;

action=login&lgname=<bot username>&lgpassword=<bot password>&format=php

 

To obtain the token I am using the following parameters in a GET request ;

action=query&intoken=edit&titles=IBWikiBotTest&prop=info|revisions&format=php.

 

The following parameters are then used as part of a POST request in the attempt to create a new page;

action=edit&title=IBWikiBotTest&summary=Page created by the IBWikiBot.&text=This is some test content added by the IBWikiBot.&md5=e21e79d8ee8ee6b5038c9bac090decf1&bot&recreate&token=0e72e13613a9408646cae5aa1a630d0a+\\&format=php

 

The unserialized response from the API is:

Array

(

    [error] => Array

        (

            [code] => badtoken

            [info] => Invalid token

        )

)

 

Any insight on this would be greatly appreciated.

 

Marcus Ramsden

 

---

Marcus Ramsden

Technical Project Assistant

Learning Societies Laboratory, Electronics and Computer Science

University of Southampton

3069, Building 32, Highfield Campus

Southampton SO17 1BJ

www.southampton.ac.uk/ecs