MediaWiki API 帮助

这是自动生成的MediaWiki API文档页面。

文档和例子:-{R|https://www.mediawiki.org/wiki/API:Main_page/zh}-

action=createaccount (create)

main | createaccount
  • 此模块需要写入权限。
  • 此模块只允许POST请求。
  • 来源:MediaWiki
  • 许可协议:GPL-2.0+

创建一个新用户账户。

使用此模块的一般程序是:

  1. 通过amirequestsfor=create取得来自action=query&meta=authmanagerinfo的可用字段,和来自action=query&meta=tokenscreateaccount令牌。
  2. 向用户显示字段,并获得其提交内容。
  3. 发送至此模块,提供createreturnurl及任何相关字段。
  4. 在响应中检查status
    • 如果您收到了PASSFAIL,您已经完成。操作要么成功,要么不成功。
    • 如果您收到了UI,present the new fields to the user and obtain their submission. Then post to this module with createcontinue and the relevant fields set, and repeat step 4.
    • 如果您收到了REDIRECT,direct the user to the redirecttarget and wait for the return to createreturnurl. Then post to this module with createcontinue and any fields passed to the return URL, and repeat step 4.
    • 如果您收到了RESTART,that means the authentication worked but we don't have a linked user account. You might treat this as UI or as FAIL.
参数:
createrequests

Only use these authentication requests, by the id returned from action=query&meta=authmanagerinfo with amirequestsfor=create or from a previous response from this module.

通过|替代物隔开各值。 值的最高数字是50(对于机器人则是500)。
createmessageformat

返回消息使用的格式。

以下值中的一个:htmlwikitextrawnone
默认:wikitext
createmergerequestfields

合并用于所有身份验证请求的字段信息至一个数组中。

类型:布尔值(详细信息
createpreservestate

从之前失败的登录尝试中保持状态,如果可能。

如果action=query&meta=authmanagerinfo返回用于hasprimarypreservedstate的真值,标记为primary-required的请求应被忽略。如果它返回用于preservedusername的非空值,用户名必须用于username参数。

类型:布尔值(详细信息
createreturnurl

Return URL for third-party authentication flows, must be absolute. Either this or createcontinue is required.

Upon receiving a REDIRECT response, you will typically open a browser or web view to the specified redirecttarget URL for a third-party authentication flow. When that completes, the third party will send the browser or web view to this URL. You should extract any query or POST parameters from the URL and pass them as a createcontinue request to this API module.

createcontinue

此请求是在早先的UIREDIRECT响应之后的附加请求。必需此值或createreturnurl

类型:布尔值(详细信息
createtoken

action=query&meta=tokens取回的“createaccount”令牌

这个参数是必须的。
*
此模块允许额外参数,取决于可用的身份验证请求。使用action=query&meta=authmanagerinfoamirequestsfor=create(或之前来自此模块的相应,如果可以)以决定可用请求及其使用的字段。