API:ChangeContentModel/de-formal
This page is part of the MediaWiki Action API documentation. |
MediaWiki Version: | ≥ 1.35 |
POST request to change the content model of a page.
API-Dokumentation
action=changecontentmodel(main | changecontentmodel)
Change the content model of a page Specific parameters: Other general parameters are available.
Example:
|
Beispiel
Making any POST request is a multi-step process:
- Log in, via one of the methods described on API:Login .
- 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 request
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 [try in ApiSandbox]
Response
{
"changecontentmodel": {
"title": "Main Page",
"pageid": 123,
"contentmodel": "text",
"logid": 100,
"revid": 200
}
}
Possible errors
Code | Info |
---|---|
notoken | The token parameter must be set. |
missingtitle | The page you specified doesn't exist. To create a new page with a custom content model, use the action=edit module. |
nodirectediting | Das Inhaltsmodell $1 unterstützt keine direkte Bearbeitung |
nochanges | No changes were requested. |
cannotbeused | Das Inhaltsmodell $1 kann nicht für $2 verwendet werden |
cannot-convert | Das Inhaltsmodell $1 konnte nicht in $2 konvertiert werden |