API:ChangeContentModel/ja
このページは MediaWiki 操作 API の説明文書の一部です。 |
MediaWiki バージョン: | ≧ 1.35 |
POST request to change the content model of a page.
APIの説明文書
例
Making any POST request is a multi-step process:
- Log in, via one of the methods described on API:ログイン .
- GET a CSRF token .
- Send a POST request, with the CSRF token, to take action on a page.
The sample code below covers the final step in detail.
POST リクエスト
Page&model=text&token=123ABC&format=json api.php? action=changecontentmodel& title=Main Page& model=text& token=123ABC& format=json Page&model=text&token=123ABC&format=json [ApiSandbox で試用する]
レスポンス
{
"changecontentmodel": {
"title": "Main Page",
"pageid": 123,
"contentmodel": "text",
"logid": 100,
"revid": 200
}
}
起こりうるエラー
Code | 情報 |
---|---|
notoken | パラメーター token を設定してください。 |
missingtitle | The page you specified doesn't exist. To create a new page with a custom content model, use the action=edit module. |
nodirectediting | $1 content model does not support direct editing |
nochanges | No changes were requested. |
cannotbeused | $1 content model cannot be used on $2 |
cannot-convert | Could not convert $1 to $2 content model |