API:REST API/Reference/ja

REST API拡張機能を使うと、MediaWikiに一位のURLのHTTPリクエストを送って作業ができます. このAPIを用いてアプリやスクリプトを構築してウィキページの検索や頁変更履歴の探索ができます.

= 検索 =



検索結果のオブジェクト
The search result object represents a wiki page matching the requested search.

Search pages
Searches wiki page titles and contents for the provided search terms, and returns matching pages.

Autocomplete page title
Searches wiki page titles, and returns matches between the beginning of a title and the provided search terms. You can use this endpoint for a typeahead search that automatically suggests relevant pages by title.

レスポンス
= 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. The response includes a  header containing the API endpoint to fetch the new 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. To get a CSRF token, see the Action API.

例


Update page
Updates or 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. To get a CSRF token, see the Action API.

To update a page, you need the page's latest revision ID and the page source. First call the get page source endpoint, and then use the  and   to update the page. If  doesn't match the page's latest revision, the API resolves conflicts automatically when possible. In the event of an edit conflict, the API returns a 409 error.

To create a page, omit  from the request.

パラメーター


Get page
Returns the standard page object for a wiki page, including the API route to fetch the latest content 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.

レスポンス


HTMLの取得
固有のウィキページについて最新のコンテンツをHTMLで返します.

レスポンス


言語を取得
接続済みのウィキを検索して同じ主題を扱う異なる言語版を探します. 戻り値は一連のページ言語のオブジェクトのうち言語名、言語コード、翻訳したページ題名を示します.

レスポンス


ページ内のファイルを取得
特定のページに載ったメディアファイルの情報を返します.

レスポンス
 = メディアファイル =



ファイルのオブジェクト
ファイルオブジェクトは特定のウィキにアップロードされた特定のファイルを示します.

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

レスポンス
= History =

Revision object
The revision object represents a change to a wiki page.

Get page history
Returns information about the latest revisions to a wiki page, in segments of 20 revisions, starting with the latest revision. The response includes API routes for the next oldest, next newest, and latest revision segments, letting you scroll through page history.

レスポンス


Get page history counts
Returns data about a page's history.

レスポンス


Get revision
Returns details for an individual revision.

Compare revisions
Returns data that lets you display a line-by-line comparison of two revisions. (See an example.) Only text-based wiki pages can be compared.

レスポンス
