We should make it easy for thirs parties to do the Right Thing when calling MediaWiki APIs. A good way to do this is to provide a client library (aka an SDK). We would of course need one per language, but JavaScript is probably a good start.
Features to shoot for:
- Support for JS in browsers and node.js (using Superagent?)
- Require a user agent string to be set explicitly.
- Support throttling
- Error reporting and logging of warnings included in the response
- Support deprecatin/sunset headers
- Fail-on-warning for use during testing
- Automatc retry on a configurable set of failure
- Support for Retry-After headers
- Support for logging in and automatically providing authentication tokens along with requests
- Support both REST and Action APIs.
Existing client libaries/frameworks, for reference: https://www.mediawiki.org/wiki/API:Client_code