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。