Hi,
I’ve a problem getting the correct token for these requests. The tokens can be aquired by API tokens module https://www.mediawiki.org/wiki/API:Tokens. This can be done employing Python, PHP or JavaScript. API modules (actions) are listed on the main page https://www.mediawiki.org/wiki/Wikibase/API.
According to documentation we make a request to order a token:
https://www.mediawiki.org/wiki/Special:ApiSandbox#action=query&format=json&meta=tokens
And we get response:
{
"batchcomplete": "",
"query": {
"tokens": {
"csrftoken": "ef0...95+\\"
}
}
}
If we perform Wikidata API request without token:
and we get following response:
{
"error": {
"code": "missingparam",
"info": "The \"token\" parameter must be set.",
"*": "See ... changes."
},
"servedby": "mw1404"
}
It requires a token. Therefore, the request for our goal with Wikidata API should be:
The response is:
{
"error": {
"code": "mustpostparams",
"info": "The following parameter was found in the query string, but must be in the POST body: token.",
"*": "See ... changes."
},
"servedby": "mw1359"
}
When I created a POST request with token in body, I got an error again that token parameter is missing in URL.
How could I fix my quite simple GET request that it works?
Thanks