**Story**
"As a Contributor, I want to get a list of revisions that I have made, to get a sense of the scale and importance of my own work."
A rough equivalent of the [[ https://en.wikipedia.org/wiki/Special:Contributions/EProdromou_(WMF) | user contributions ]] page in REST form. Compare T235073, which gets the contributions for //other// users.
**Done Criteria**
[x] A non-logged-in client will receive a Status 401 [[ https://gerrit.wikimedia.org/r/c/mediawiki/core/+/601900 | Patch ]]
[x] Returns a list of N page revisions by the current logged-in user [[ https://gerrit.wikimedia.org/r/c/mediawiki/core/+/602141 | Patch ]]
- Response object must be JSON
- Response object must contain the following fields:
- revisions: an array of 0 to segment_size 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
- size: count of bytes
- page: Page that was modified, JSON object with the following properties: {id, key, title} (see the schema for details)
[ ] Suppressed revisions are not exposed to unauthorized users, but visible to authorized users [[ https://gerrit.wikimedia.org/r/c/mediawiki/core/+/603929 | Patch ]]
[ ] The client should be able to request the next, previous, and latest segments so that the client will eventually receive all contributions. For this purpose, the response should contain the following properties: [[ https://gerrit.wikimedia.org/r/c/mediawiki/core/+/602336 | Forward paging patch ]] | [[ https://gerrit.wikimedia.org/r/c/mediawiki/core/+/602611 | Backward paging patch ]]
- "older": Full link to API endpoint + "before|" + rev ID or rev timestamp. May be excluded if there are no known older revisions.
- "newer": Full link to API endpoint + "after|" + rev ID or rev timestamp
- "latest": Full link to API endpoint without parameters
[ ] There is a stable chronological order among the revisions, based on the combination of revision ID AND revision timestamp [[ https://gerrit.wikimedia.org/r/c/mediawiki/core/+/598419 | Patch ]]
[ ] Each revision should also have the field: delta: +/- count of bytes changed from previous [[ https://gerrit.wikimedia.org/r/c/mediawiki/core/+/602617 | Patch ]]
[ ] Each revision should also have the field: tags: array of Tag objects with [ tag, url ], per schema [[ https://gerrit.wikimedia.org/r/c/mediawiki/core/+/596011 | Patch ]]
**Designs/Interface/Mockups**
GET /me/contributions?segment=<segment-marker>&segment_size=<segment_size>
Segmented contribution history by user with name `name`. (I'm calling it "segmented" instead of "paged" so we don't all go crazy.)
segment_marker: ( "before" | "after" ) "|" timestamp "|" revision_id
segment_size: size of the segment to get; minimum is 1, default is 20, and maximum 100
Request body: none
Notable request headers: none
Status:
200 - OK
401 - not authenticated
400 - invalid segment marker or segment size is out of bounds
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. oldest segment will have this field null. all other segments will have a value.
newer: full link to API endpoint for the next newer segment of results. This will never be null (to account for edits occurring after we get results)
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, in reverse chronological order, 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 bogobytes changed from previous
size: count of bogobytes
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)
tags: array of Tag objects (see schema)
**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."