We'd like to expose revision scoring data produced by the revscoring service in a way that
- can be used by production tools and gadgets,
- does not introduce security vulnerabilities,
- performs and scales well,
- is discoverable and well documented, and
- is easy to use for developers and gadget authors.
We can achieve many of these objectives by setting up entry points in the RESTBase REST API:
- the entry points become part of the wider REST content API, which makes them discoverable
- interactive sandbox & documentation encourages experimentation & helps developers get started
- revision scores can be stored
- request latency is low
- RESTBase enforces valid JSON syntax and sends CSP headers for security
- metrics covering request latencies and status are automatically provided per entry point, as well as all requests to the revscoring service
API strawman
The current entry points exposed by the revscoring service are:
- Article quality: http://ores.wmflabs.org/scores/enwiki/wp10/668898500/
- Damage detection: http://ores.wmflabs.org/scores/enwiki/reverted/668898500/
Additional types of scores will likely be added later.
Based on this, we could consider hooking this up as
- /api/rest_v1/page/revision/{revision}/score/wp10
- /api/rest_v1/page/revision/{revision}/score/reverted
By default, /api/rest_v1/page/revision/{revision}/score/ would provide a listing of available scores. Each score type has its own documentation section, which can include rich markdown content with links to background information.