Changes

Jump to navigation Jump to search
2,985 bytes added ,  04:11, 19 February 2016
m
1 revision imported: All the templates from MediaWiki.com
{{Documentation subpage}}
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->

:''Consider replacing invocations of this template with Special:ApiHelp transclusion ([[phab:T89318]]), since filling in this template redundantly repeats API parameter documentation in source code.''

== Usage ==
This template can be used to document API parameters. Its intent is to harmonize the appearance of template parameters across all of the API pages.
{{Pre2|style=display:inline-block
|1=<nowiki>{{ApiParam
|</nowiki>''name=''<nowiki>
|</nowiki>''description=''<nowiki>
|bullet=
|required=
|maxallowed=
|maxallowedbot=
|type=
|values=
|default=
|version=
|deprecated=
|removed=
}}</nowiki>}}

{| class="wikitable sortable"
! colspan=2 | ApiParam parameters
|-
! Parameter Name || Description
|-
| <code>'''name'''</code> ''(or first unnamed)'' || The parameter name (required).
|-
| <code>description</code> ''(or second unnamed'') || A description of the parameter.
|-
| <code>bullet</code> || For values that have full descriptions of their own, as is often the case with <code>prop</code> parameters, can be used to add extra *'s to the bullet.
|-
| <code>required</code> || Specify a value if the parameter is required. The name of the required parameter will be bolded.
|-
| <code>maxallowed</code> || For pipe-separated values or numeric quantities, the maximum allowed.
|-
| <code>maxallowedbot</code> || As above, for bots. If 50 or 500 is used for <code>maxallowed</code>, this will default to 500 or 5000, respectively.
|-
| <code>type</code> || The data type of the parameter.
|-
| <code>values</code> || A list of possible values for the parameter.
|-
| <code>default</code> || The default value for the parameter.
|-
| <code>version</code> || The version the parameter was introduced in. Use the plain MediaWiki version number only.
|-
| <code>deprecated</code> || The version the parameter was deprecated in. Use the plain MediaWiki version number only.
|-
| <code>removed</code> || The version the parameter was removed in. Use the plain MediaWiki version number only.
|}

== Examples ==
<pre style="display:inline-block">{{ApiParam|amfilter|Return only messages with names that contain this string}}</pre>
{{ApiParam|amfilter|Return only messages with names that contain this string}}

<pre style="display:inline-block">{{ApiParam|siprop|Which properties to get|default=general}}
{{ApiParam|bullet=*|general|General site information}}
{{ApiParam|bullet=**|articlepath|[[$wgArticlePath]]|version=1.15}}</pre>
{{ApiParam|siprop|Which properties to get|default=general}}
{{ApiParam|bullet=*|general|General site information}}
{{ApiParam|bullet=**|articlepath|[[$wgArticlePath]]|version=1.15}}

== See also ==
* {{tl|Parameter}} &ndash; older version of ApiParam

<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Typing-aid templates]]
[[Category:Formatting templates]]
}}</includeonly>

Navigation menu