API:REST API/Pages

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

 Request examples 

 Request body schema 

 Responses 

 Response schema 

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. This endpoint responds to the presence of a logged-in user and allows updates appropriate to that user's permissions.

When updating the page, the client should always first fetch the page content from the GET page source endpoint, modify the source, and copy the content of the  key. In the event of an edit conflict, this endpoint performs automatic conflict resolution if possible.

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

 Request examples 

 Request parameters 

 Request body schema 

 Responses 

 Response schema 

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. This endpoint responds to the presence of a logged-in user and displays content appropriate to that user's permissions.

To use this endpoint on your wiki, install RESTBase and configure VirtualRESTService.

 Request examples 

 Request parameters 

 Responses 

 Response schema 

Get page offline
Returns information about a wiki page, including the license, information about the latest revision, and the latest content of the page as HTML. See the HTML 2.1.0 spec for a description of the MediaWiki-specific semantic markup in this HTML. Note that additional metadata is available in the HTML head. This endpoint responds to the presence of a logged-in user and displays content appropriate to that user's permissions.

To use this endpoint on your wiki, install RESTBase and configure VirtualRESTService.

 Request examples 

 Request parameters 

 Responses 

 Response schema 

Get page source
Returns the content of a wiki page in the format specified by the  property, the page license, and information about the latest revision. This endpoint responds to the presence of a logged-in user and displays content appropriate to that user's permissions.

 Request examples 

 Request parameters 

 Responses 

 Response schema 

Get HTML
Returns the latest HTML for a wiki page. See the HTML 2.1.0 spec for a description of the MediaWiki-specific semantic markup in this HTML. Note that additional metadata is available in the HTML head. This endpoint responds to the presence of a logged-in user and displays content appropriate to that user's permissions.

To use this endpoint on your wiki, install RESTBase and configure VirtualRESTService.

 Request examples 

 Request parameters 

 Responses 

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. This endpoint responds to the presence of a logged-in user and displays content appropriate to that user's permissions.

 Request examples 

 Request parameters 

 Responses 

 Response schema 

Get media files
Returns information about media files used on a wiki page. This endpoint responds to the presence of a logged-in user and displays content appropriate to that user's permissions.

 Request examples 

 Request parameters 

 Responses 

 Response schema