[Engineering] [Wikitext-l] [Mediawiki-api] [Wikitech-l] Deprecating rest.wikimedia.org in favor of /api/rest_v1/

Gabriel Wicke gwicke at wikimedia.org
Mon Feb 1 22:13:49 UTC 2016


Hi Luigi,

On Fri, Jan 29, 2016 at 12:31 PM, Luigi Assom <itsawesome.yes at gmail.com> wrote:
> -  how to extract _ID from ETag in headers:
> GET /page/title/{title}

the page id is indeed not directly exposed in the HTML response.
However, the revision number is exposed as part of the ETag. This can
then be used to request revision metadata including the page id at
https://en.wikipedia.org/api/rest_v1/?doc#!/Page_content/get_page_revision_revision.
This is admittedly not very convenient, so I created
https://phabricator.wikimedia.org/T125453 for generally improved page
id support in the REST API.

> - how to ensure
> GET /page/title/{title with different char encoding or old titles are always
> resolved to last canonical version}

The storage backing this end point is automatically kept up to date
with edits and dependency changes. Edits in particular should be
reflected within a few seconds.

>> If you refer to
>>
>> https://en.wikipedia.org/api/rest_v1/?doc#!/Page_content/get_page_graph_png_title_revision_graph_id,
>> this is an end point exposing rendered graph images for
>> https://www.mediawiki.org/wiki/Extension:Graph (as linked in the end
>> point documentation).
>
>
> Oh very interesting!
> So basically html markup can be extended ?
> Would it be possible to share json objects as html5 markup and embed them in
> wiki pages?

The graph extension is using the regular MediaWiki tag extension
mechanism: https://www.mediawiki.org/wiki/Manual:Tag_extensions

Graphs are indeed defined using JSON within this tag.

> I want to avoid to update my graph just because titles changes: entities are
> always the same.

Makes sense. The current API is optimized for the common case of
access by title, but we will consider adding access by page ID as
well.

> I still don't know what parsoid is.

Parsoid is the service providing semantic HTML and a bi-directional
conversion between that & wikitext:
https://www.mediawiki.org/wiki/Parsoid

Gabriel



More information about the Engineering mailing list