MediaWiki API 說明
此頁為自動產生的 MediaWiki API 說明文件頁面。
說明文件與範例:https://www.mediawiki.org/wiki/API
action=revisiondelete
(main | revisiondelete)
- 此模組需要讀取權限。
- 此模組需要寫入權限。
- 此模組僅接受 POST 請求。
- 來源:MediaWiki
- 授權條款:GPL-2.0-or-later
刪除和取消刪除修訂。
參數:
- type
正執行的修訂刪除類型。
- 此參數為必填。
- 單值:revision、archive、oldimage、filearchive、logging
- target
要修訂刪除的頁面標題,若類型有所需要。
- ids
要刪除的修訂識別碼。
- 此參數為必填。
- 將幾個值以 | 或 alternative 分隔。 上限值為 50(機器人為 500)。
- hide
各修訂所要隱藏的內容。
- 多值 (以 | 或 alternative 分隔):content、comment、user
- show
各修訂所要取消隱藏的內容。
- 多值 (以 | 或 alternative 分隔):content、comment、user
- suppress
是否對管理者及其他使用者禁止資料。
- 單值:yes、no、nochange
- 預設值:nochange
- reason
刪除或取消刪除的原因。
- tags
在刪除日誌裡套用到項目的標籤。
- 多值 (以 | 或 alternative 分隔):
- token
自 action=query&meta=tokens 接收的「csrf」權杖。
- 此參數為必填。
範例:
- 隱藏在頁面 Main Page 的修訂 12345 內容。
- api.php?action=revisiondelete&target=Main%20Page&type=revision&ids=12345&hide=content&token=123ABC [在沙盒中開啟]
- 以原因:BLP violation,來隱藏在日誌項目 67890 上的所有資料。
- api.php?action=revisiondelete&type=logging&ids=67890&hide=content|comment|user&reason=BLP%20violation&token=123ABC [在沙盒中開啟]