**Story**
"As a Moderator, I want to get a list of revisions of pages a user has created or updated, to judge the user’s intentions and ability."
A rough equivalent is the [[ https://en.wikipedia.org/wiki/Special:Contributions/EProdromou_(WMF) | user contributions ]] page in REST form.
**Designs/Interface/Mockups**
GET /user/{name}/contributions?{older_than|newer_than={id}}
GET /me/contributions?{older_than|newer_than={id}}
Segmented contribution history by user with name `name`. (I'm calling it "segmented" instead of "paged" so we don't all go crazy.)
The synonym `/me/contributions` can be used to get the current logged-in user's contributions.
{name} is the user name.
If older_than is provided, only show the newest revisions strictly older than the given revision ID, non-inclusive.
If newer_than is provided, only show the oldest revisions strictly newer than the given revision ID, non-inclusive.
Only one of older_than or newer_than are allowed.
Request body: none
Notable request headers: none
Status:
200 - OK
401 - not authenticated; only used for the `/me` synonym
404 – no such user
Notable response headers: none
Body: JSON, an object with the following fields:
older: full link to API endpoint for the next older segment of results (usually the same endpoint plus "older_than" with the last revision in this segment). May be excluded if there are no known older revisions.
newer: full link to API endpoint for the next newer segment of results (usually the same endpoint plus "newer_than" parameter for first revision in this segment). May be excluded if there are no known older revisions.
latest: full link to API endpoint for the latest values, usually just this endpoint with no parameters
revisions: an array of 0 to 20 revision objects, each with the following information:
id: revision id
comment: edit summary of the change, provided by the user
timestamp: date of change, YYYY-MM-DDTHH:MM:SSZ
delta: +/- count of bytes changed from previous
size: count of bytes
page: Page that was modified, JSON object with the following properties: {id, key, title} (see [[ https://www.mediawiki.org/wiki/Core_Platform_Team/Initiatives/Core_REST_API_in_MediaWiki/Schema | schema ]] for details)
**Acceptance Criteria**
[ ] Returns a list of page revisions created by a given contributor
[ ] Returns a list of page revisions updated by a given contributor
[ ] Returns a list of page revisions created for the current logged-in user
[ ] Returns a list of page revisions updated for the current logged-in user
[ ] Returns a list of page revisions created or updated by a given contributor older than, but not including, a given revision ID
[ ] Returns a list of page revisions created or updated by a given contributor newer than, but not including, a given revision ID
[ ] Only one of older_than or newer_than are permitted
[ ] Returned list must segmented based on a LIMIT
[ ] Response object must be JSON
[ ] Response object must contain the following fields:
- older: full link to API endpoint for the next older segment of results (usually the same endpoint plus "older_than" with the last revision in this segment). May be excluded if there are no known older revisions.
- newer: full link to API endpoint for the next newer segment of results (usually the same endpoint plus "newer_than" parameter for first - revision in this segment). May be excluded if there are no known older revisions.
- latest: full link to API endpoint for the latest values, usually just this endpoint with no parameters
- revisions: an array of 0 to 20 revision objects, each with the following information:
- id: revision id
- comment: edit summary of the change, provided by the user
- timestamp: date of change, YYYY-MM-DDTHH:MM:SSZ
- delta: +/- count of bytes changed from previous
- size: count of bytes
- page: Page that was modified, JSON object with the following properties: {id, key, title} (see the schema for details)
**Related Stories**
"As a Reader, I want to get a list of revisions of pages a Contributor has created or updated, because I want to read more of what they have written."
"As a Contributor, I want to get a list of revisions of pages another Contributor has created or updated, because I want to contribute to pages that are similar to ones that I've collaborated on with that person."
"As a Curator, I want to get a list of revisions of pages a Contributor has created or updated, because they may have made a repeated mistake on multiple pages."