Please note that User Registration has been temporarily disabled due to a recent increase in automated registrations. If anyone needs an account, please request one here: RequestAccount. Thanks for your patience!--Wmat (talk)
Please email User:Wmat if you experience any issues with the Request Account form.

Template:ApiEx

From eLinux.org
Jump to: navigation, search

This template is used by the API documentation pages to format example queries.

Usage:

{{ApiEx
| desc=Capitalization, localization, "_" => " ", "Project" => "Wikipedia", ...
| p1=action=query
| p2=titles=Project:articleA{{!}}article_B
| result=<source lang="xml">
<api>
  <query>
    <normalized>
      <n from="Project:articleA" to="Wikipedia:ArticleA" />
      <n from="article_B" to="Article B" />
    </normalized>
    <pages>
      <page ns="4" title="Wikipedia:ArticleA" missing="" />
      <page ns="0" title="Article B" missing="" />
    </pages>
  </query>
</api>
</source>
}}

Capitalization, localization, "_" => " ", "Project" => "Wikipedia", ...

<api>
  <query>
    <normalized>
      <n from="Project:articleA" to="Wikipedia:ArticleA" />
      <n from="article_B" to="Article B" />
    </normalized>
    <pages>
      <page ns="4" title="Wikipedia:ArticleA" missing="" />
      <page ns="0" title="Article B" missing="" />
    </pages>
  </query>
</api>

Parameters:

  • desc - query description
  • lang - two letter code for the wiki language. 'en' by default.
  • p1-p9 - parameter groups, each containing one or more param=value pairs separated by an ampersand (&).
  • result - the result of the query execution
  • post - a "list" of ApiEx/Post objects, to generate a post table