User:Ola Efimova/Sandbox/API:Checktoken

From mediawiki.org
MediaWiki version:
1.25

API documentation[edit]

Checks the validity of a token from the tokens module.


Module "tokens" not found.

Example[edit]

GET request[edit]

Description of script


Response[edit]

{
    "warnings": {
        "checktoken": {
            "*": "Check that symbols such as \"+\" in the token are properly percent-encoded in the URL."
        }
    },
    "checktoken": {
        "result": "invalid"
    }
}

Sample code[edit]

Python[edit]

#!/usr/bin/python3

"""
    hello.py

    MediaWiki Action API Code Samples
    Demo of `...` module
    MIT license
"""

PHP[edit]

<?php
/*
    hello.php

    MediaWiki API Demos
    Demo of `...` module

    MIT License
*/
a:2:{s:8:"warnings";a:1:
    {s:10:"checktoken";a:1:
    {s:1:"*";s:84:"Check that symbols such as "+" in the token are properly percent-encoded in the URL.";}}
    s:10:"checktoken";a:1:
        {s:6:"result";s:7:"invalid";}}

Javascript[edit]

/*
    hello.js

    MediaWiki API Demos
    Demo of `...` module

    MIT License
*/

MediaWiki JS[edit]

/*
	hello.js

	MediaWiki API Demos
	Demo of `...` module

	MIT License
*/

Demo app(s)[edit]

Additional notes[edit]

See also[edit]