API:Delete/ja
From MediaWiki.org
< API:Delete(Redirected from API:Edit - Delete/ja)
| MediaWiki バージョン: | 1.12 |
Contents |
トークン [edit]
ページを削除するために、deleteトークンが必要です。このトークンはeditトークンと等しくすべてのページに対して同じですが、ログインするごとに変わります。deleteトークンは次のように取得できます:
| 結果 |
|---|
| The following content has been placed in a collapsed box for improved usability. |
<?xml version="1.0" encoding="utf-8"?> <api> <query> <pages> <page pageid="1" ns="0" title="Main Page" touched="2007-09-03T20:32:21Z" lastrevid="20" counter="20" length="470" deletetoken="58b54e0bab4a1d3fd3f7653af38e75cb+\" /> </pages> </query> </api> |
| The above content has been placed in a collapsed box for improved usability. |
ページの削除 [edit]
ページはaction=deleteで削除できます。
パラメータ [edit]
- title: 削除したいページ。
- pageid: The page id of the page you want to delete
- token: 以前のリクエストで取得されたトークン。'+'を'%2B'にurlencodeすることに注意して下さい
- reason: 削除の理由(オプション)。提供されない場合、自動的に生成された理由が使われます。
- watch: Add the page to your watchlist
- unwatch: Remove the page from your watchlist
- oldimage: The name of the old image to delete as provided by iiprop=archivename
例 [edit]
Note: In this example, all parameters are passed in a GET request just for the sake of simplicity. However, action=delete requires POST requests; GET requests will cause an error.
| 結果 |
|---|
| The following content has been placed in a collapsed box for improved usability. |
<?xml version="1.0" encoding="utf-8"?> <api> <delete title="Main Page" reason="content was: 'content goes here' and the only contributor was Username" /> </api> |
| The above content has been placed in a collapsed box for improved usability. |
起こり得るエラー [edit]
通常のものに加えて次のものがあります:
- code: notitle
- info: titleパラメータを設定しなければなりません
- code: notoken
- info: tokenパラメータを設定しなければなりません
- code: permissiondenied
- info: ページを削除するパーミッションがありません
- 大抵のwikiでは、ページを削除することはsysopに制限されていますが、別のwikiの中にもより厳密なルールを持つものがあります。
- info: ページを削除するパーミッションがありません
- code: cantdelete
- info: ``title''を削除できませんでした。おそらく他の誰かによって既に削除されました