User:APaskulin (WMF)/Sandbox/Reference

This page is a staging area for documentation for endpoints in the coredev namespace of the MediaWiki REST API.

= Pages =

Page object
The page object represents the latest revision of a wiki page.

Page language object
The page language object represents a wiki page and its language.

Create page
Creates a wiki page. This endpoint is designed to be used with the OAuth extension authorization process. Callers using cookie-based authentication instead must add a CSRF  to the request body. See the Action API docs to learn how to get a CSRF token.

Update page
Updates an existing wiki page. You can also use this endpoint to create a page by omitting the  property from the request body.

When updating a page, first fetch the page content from the get page source endpoint, copy the value of the  property, and then modify the source. If an update conflicts with the latest revision, this endpoint tries to resolve conflicts automatically.

This endpoint is designed to be used with the OAuth extension authorization process. Callers using cookie-based authentication instead must add a CSRF  to the request body. See the Action API docs to learn how to get a CSRF token.

Get page
Returns the standard page object for a wiki page, including the API route to fetch the content of the page in HTML, the license, and information about the latest revision.

Get page offline
Returns information about a wiki page, including the license, latest revision, and latest content in HTML.

Get page source
Returns the content of a wiki page in the format specified by the  property, the license, and information about the latest revision.

Get HTML
Returns the latest content of a wiki page in HTML.

Get languages
Searches connected wikis for pages with the same topic in different languages. Returns an array of language objects that include the name of the language, the language code, and the translated page title.

Get media files
Returns information about media files used on a wiki page.

Responses
= Media files =

File object
The file object represents a file uploaded to a wiki.

Get file
Returns information about a file, including links to download the file in thumbnail, preview, and original formats.

Responses
= Contributions =