Page MenuHomePhabricator

Reading List REST Interface: GET lists/changes/since endpoint
Closed, ResolvedPublic

Description

Create a REST handler and any other necessary associated code (extension.json entry, helper classes, etc.) for the GET lists/changes/since endpoint.

  • endpoint implemented
  • tests created
  • tests pass

Endpoint summary:
Get recent changes to the lists

Endpoint description:
Returns metadata describing lists and entries which have changed. Might be truncated and include a continuation token.
Request must be authenticated with a MediaWiki session cookie.
For safe synchronization, the date parameter should be taken from the continue-from field of a previous GET /lists/ or GET /lists/changes/since/{date} request. This will ensure that no changes are skipped, at the cost of sometimes receiving the same change multiple times. Clients should handle changes in an idempotent way.
Stability: unstable

Associated RESTBase code
lists.yaml (spec+forwarding)
lists.js (tests)

Associated Action API code
ApiQueryReadingListEntries
ApiQueryReadingListEntriesTest

Parameters:

namesourcerequiredtypeexampledefaultpossible valuesdescription
datepathyesstring (date-time)N/AN/ACutoff date (in ISO 8601). To ensure reliable synchronization, the API might return changes which are slightly older than the cutoff date.
nextquerynostringN/AN/AContinuation parameter from previous request

Error Response

#/components/schemas/problem per API.md and draft-nottingham-http-problem

Success Response

valuetypedescription
listsarray: list_read
nextstringContinuation token
continue-fromstring (date-time)Timestamp to sync from, to be used with the GET /lists/changes/since/{date} endpoint.

Response Headers

This endpoints has additional response headers specified in the RESTBase code:

headers:
  content-type: application/json; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/Lists/0.1"
  cache-control: max-age=0, s-maxage=0

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
BPirkle renamed this task from Reading List REST Interface: create lists/changes/since GET endpoint to Reading List REST Interface: GET lists/changes/since endpoint.Nov 14 2023, 2:58 AM
BPirkle updated the task description. (Show Details)

Change 983241 had a related patch set uploaded (by BPirkle; author: BPirkle):

[mediawiki/extensions/ReadingLists@master] REST Handlers for managing reading lists

https://gerrit.wikimedia.org/r/983241

Change 983241 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] REST Handlers for managing reading lists

https://gerrit.wikimedia.org/r/983241

Added the following parameters that were previously exposed by the underlying Action API endpoint, but not by RESTBase:

namesourcerequiredtypeexampledefaultpossible valuesdescription
sortquerynostringupdatednamename, updatedsort type
dirquerynostringdescendingascendingascending, descendingsort direction
limitquerynointeger5101..10Maximum number of values to return
BPirkle updated the task description. (Show Details)