API:Parameter information

From MediaWiki.org
Jump to: navigation, search
Tools clipart.png This page is part of the MediaWiki API documentation.
Language: English  • Deutsch • polski
MediaWiki API

Quick overview:

v · d · e
MediaWiki version: 1.12

Contents

[edit] Obtaining parameter information

You can obtain information about modules and their parameters through action=paraminfo.

[edit] Parameters

  • modules: A list of top-level module names (value of the action= parameter)
  • querymodules: A list of query module names (value of the prop=, meta= or list= parameter)

[edit] Example

Getting information about action=parse and prop=info

<?xml version="1.0" encoding="utf-8"?>
<api>
  <paraminfo>
    <modules>
      <module classname="ApiParse" description="This module parses wikitext and returns parser output" prefix="" name="parse">
        <parameters>
          <param name="title" default="API" description="Title of page the text belongs to" />
          <param name="text" />
          <param name="page" />
          <param name="oldid" />
          <param name="prop" default="text|langlinks|categories|links|templates|images|externallinks|sections|revid" multi="" limit="500" description="Which pieces of information to get.&#10;NOTE: Section tree is only generated if there are more than 4 sections, or if the __TOC__ keyword is present">
            <type>
              <t>text</t>
              <t>langlinks</t>
              <t>categories</t>
              <t>links</t>
              <t>templates</t>
              <t>images</t>
              <t>externallinks</t>
              <t>sections</t>
              <t>revid</t>
            </type>
          </param>
        </parameters>
      </module>
    </modules>
    <querymodules>
      <module classname="ApiQueryInfo" description="Get basic page information such as namespace, title, last touched date, ..." prefix="in" name="info">
        <parameters>
          <param name="prop" multi="" limit="500" description="Which additional properties to get:&#10; &quot;protection&quot;   - List the protection level of each page&#10; &quot;talkid&quot;       - The page ID of the talk page for each non-talk page&#10; &quot;subjectid&quot;     - The page ID of the parent page for each talk page">
            <type>
              <t>protection</t>
              <t>talkid</t>
              <t>subjectid</t>
            </type>
          </param>
          <param name="token" multi="" limit="500" description="Request a token to perform a data-modifying action on a page">
            <type>
              <t>edit</t>
              <t>delete</t>
              <t>protect</t>
              <t>move</t>
              <t>block</t>
              <t>unblock</t>
              <t>email</t>
            </type>
          </param>
        </parameters>
      </module>
      <module name="blah" missing="" />
    </querymodules>
  </paraminfo>
</api>

[edit] Possible errors

None.