Jump to content

API:更改wiki內容

From mediawiki.org
This page is a translated version of the page API:Changing wiki content and the translation is 66% complete.

Changing wiki content through the API can be done through several different modules.

Please see the appropriate subsection for detailed information for each module. Write modules generally require a POST method, where read modules usually use GET methods. Exceptions are noted on individual pages.

讀取模塊

讀取模塊
模塊 Function
Changeauthenticationdata 更改當前用戶的身份驗證數據。
Checktoken action=query&meta=tokens檢查令牌有效性。
Clientlogin 使用交互式流登錄wiki。
Compare 獲取兩個頁面的差異。
Expandtemplates 展開wikitext中的所有模板。
貢獻訂閱 返回用戶貢獻綱要。
Feedrecentchanges 返回最近更改的摘要。
Feedwatchlist 返回監視列表綱要。
說明 顯示指定模塊的幫助。
Linkaccount 將來自第三方提供商的賬號連結至當前用戶。
登入 登錄並獲取認證 cookies。
登出 退出並清除會話數據。
Opensearch 使用開放搜索協議搜索wiki。
Paraminfo 獲得關於API模塊的信息。
Parse Parses content and returns parser output.
查詢 Fetch data from and about MediaWiki.
Removeauthenticationdata 從當前用戶移除身份驗證數據。
Rsd 導出一個RSD(Really Simple Discovery)架構。
Stashedit Prepare an edit in shared cache.
令牌 Get tokens for data-modifying actions.
Unlinkaccount 從當前用戶移除已連結的第三方賬號。

Write modules

寫入模塊
模塊 功能
封禁 封禁用戶。
Clearhasmsg 為當前用戶清除hasmsg標記。
Createaccount 創建新的用戶賬戶。
刪除 刪除頁面。
編輯 創建與編輯頁面。
Emailuser 向用戶發送郵件。
Filerevert 將文件回退到之前的版本。
Imagerotate 旋轉一個或多個圖片。
匯入 從其他維基或XML文件導入頁面。
Managetags Perform management tasks relating to change tags.
合併歷史 合併頁面歷史
移動 移動頁面。
Options Change preferences of the current user.
巡查 巡查頁面或修訂版本。
保護 更改頁面的保護等級。
Purge Purge the cache for the given titles.
重置密碼 向用戶發送密碼重置郵件。
API:修訂版本刪除 刪除和恢復修訂版本。
回退 撤銷由最後操作用戶對頁面作出的編輯。
Setnotificationtimestamp Update the notification timestamp for watched pages.
標籤 從個別修訂或日誌記錄中添加或移除更改標籤。
Unblock 解封一位用戶。
取消刪除 從已刪除的頁面中恢復版本。
上傳 上傳文件或獲取上傳狀態。
Userrights 更改一位用戶的組成員。
監視 從當前用戶的監視列表中添加或移除頁面。

可能的錯誤

Some wikis restrict the use of these modules to certain groups of users, or disallow it altogether. All aforementioned modules can return the following errors:

代碼 資訊
noapiwrite 通過API編輯此wiki已禁用。
writeapidenied 您不被允許通過API編輯此wiki。