TLDR: On September 1 we will remove deprecated parameters that were used to obtain tokens in MediaWiki API. If your script/tool/bot or gadget was using these deprecated parameters, it will break unless you migrate it.
MediaWiki Action API clients (tool, scripts and bots that make calls to /w/api.php) sometimes need to obtain a token before making a write operation. Before MediaWiki 1.24 (November 2014) these tokens were obtained by using `token` property in various action api endpoints:
- action=tokens [1]
- `rctoken` in action=query&list=recentchanges [2]
- `rvtoken` in action=query&prop=revisions [3]
- `intoken` in action=query&prop=info [4]
- `ustoken` in action=query&list=users[5]
- `preferencestoken` in action=query&meta=userinfo [6]
Since 2014, a new API Module action=query&meta=tokens [7] was added where all these various tokens were consolidated. You can find more documentation for the deprecated API calls in [8] and guide for the new API calls at [9]
In a nutshell, the migration is trivial. If you script/tool/gadget or bot used to make an API call like
"*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes. Use [[Special:ApiFeatureUsage]] to see usage of deprecated features by your application."
},
"tokens": {
"*": "\"action=tokens\" has been deprecated. Please use \"action=query&meta=tokens\" instead."
and change the object you pull out the token from result['tokens'] to result['query']['tokens'].
We are aiming to remove this functionality on September 1. These API calls were deprecated for 7 years and removing them will unlock some important refactoring we are working on now. We recognize this is a tight deadline, so we want to be flexible with it. If there's a need from the community to extend the deadline, please reach us on wikitech-l@lists.wikimedia.org.