Testpage

From WebChem Wiki
Jump to: navigation, search

<!DOCTYPE html> <html lang="en" dir="ltr" class="client-nojs"> <head> <meta charset="UTF-8"/> <title>MediaWiki API help - WebChem Wiki</title> <script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script> <script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgCanonicalNamespace":"Special","wgCanonicalSpecialPageName":"ApiHelp","wgNamespaceNumber":-1,"wgPageName":"Special:ApiHelp","wgTitle":"ApiHelp","wgCurRevisionId":0,"wgRevisionId":0,"wgArticleId":0,"wgIsArticle":false,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":true,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"Special:ApiHelp","wgRelevantArticleId":0,"wgRequestId":"e5519d55b708c8b8fadff951","wgIsProbablyEditable":false,"wgWikiEditorEnabledModules":{"toolbar":false,"dialogs":false,"preview":false,"publish":false},"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","usePageImages":false,"usePageDescriptions":false},"wgPreferredVariant":"en","wgVisualEditorToolbarScrollOffset":0});mw.loader.implement("user.options",function($,jQuery,require,module){mw.user.options.set({"variant":"en"});});mw.loader.implement("user.tokens",function ( $, jQuery, require, module ) { mw.user.tokens.set({"editToken":"+\\","patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"});/*@nomin*/;

});mw.loader.load(["mediawiki.page.startup","ext.visualEditor.desktopArticleTarget.init"]);});</script> <link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=ext.visualEditor.desktopArticleTarget.noscript%7Cmediawiki.apihelp%2Chlist%2CsectionAnchor%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.interface&only=styles&skin=apioutput"/> <meta name="ResourceLoaderDynamicStyles" content=""/> <link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=site&only=styles&skin=apioutput"/> <script async="" src="/w/load.php?debug=false&lang=en&modules=startup&only=scripts&skin=apioutput"></script> <meta name="generator" content="MediaWiki 1.27.0"/> <link rel="shortcut icon" href="/favicon.ico"/> <link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="WebChem Wiki (en)"/> <link rel="EditURI" type="application/rsd+xml" href="http://webchem.ncbr.muni.cz/w/api.php?action=rsd"/> <link rel="copyright" href="https://www.mediawiki.org/wiki/Special:MyLanguage/Copyright"/> <link rel="alternate" type="application/atom+xml" title="WebChem Wiki Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"/> </head> <body class="mediawiki ltr sitedir-ltr ns--1 ns-special mw-special-ApiHelp page-Special_ApiHelp rootpage-Special_ApiHelp skin-apioutput action-view">

MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

Documentation and examples: <a class="external free" href="https://www.mediawiki.org/wiki/API">https://www.mediawiki.org/wiki/API</a>

Main module

  • Source: MediaWiki
  • License: <a href="/Wiki/Special:Version/License/MediaWiki" title="Special:Version/License/MediaWiki">GPL-2.0+</a>

Status: All features shown on this page should be working, but the API is still in active development, and may change at any time. Subscribe to <a rel="nofollow" class="external text" href="https://lists.wikimedia.org/pipermail/mediawiki-api-announce/">the mediawiki-api-announce mailing list</a> for notice of updates.

Erroneous requests: When erroneous requests are sent to the API, an HTTP header will be sent with the key "MediaWiki-API-Error" and then both the value of the header and the error code sent back will be set to the same value. For more information see <a href="http://www.mediawiki.org/wiki/API:Errors_and_warnings" class="extiw" title="mw:API:Errors and warnings">API: Errors and warnings</a>.

Testing: For ease of testing API requests, see <a href="/Wiki/Special:ApiSandbox" title="Special:ApiSandbox">Special:ApiSandbox</a>.

Parameters:
action

Which action to perform.

One of the following values: <a href="/w/api.php?action=help&modules=block">block</a>, <a href="/w/api.php?action=help&modules=changeauthenticationdata">changeauthenticationdata</a>, <a href="/w/api.php?action=help&modules=checktoken">checktoken</a>, <a href="/w/api.php?action=help&modules=clearhasmsg">clearhasmsg</a>, <a href="/w/api.php?action=help&modules=clientlogin">clientlogin</a>, <a href="/w/api.php?action=help&modules=compare">compare</a>, <a href="/w/api.php?action=help&modules=createaccount">createaccount</a>, <a href="/w/api.php?action=help&modules=delete">delete</a>, <a href="/w/api.php?action=help&modules=edit">edit</a>, <a href="/w/api.php?action=help&modules=emailuser">emailuser</a>, <a href="/w/api.php?action=help&modules=expandtemplates">expandtemplates</a>, <a href="/w/api.php?action=help&modules=feedcontributions">feedcontributions</a>, <a href="/w/api.php?action=help&modules=feedrecentchanges">feedrecentchanges</a>, <a href="/w/api.php?action=help&modules=feedwatchlist">feedwatchlist</a>, <a href="/w/api.php?action=help&modules=filerevert">filerevert</a>, <a href="/w/api.php?action=help&modules=help">help</a>, <a href="/w/api.php?action=help&modules=imagerotate">imagerotate</a>, <a href="/w/api.php?action=help&modules=import">import</a>, <a href="/w/api.php?action=help&modules=linkaccount">linkaccount</a>, <a href="/w/api.php?action=help&modules=login">login</a>, <a href="/w/api.php?action=help&modules=logout">logout</a>, <a href="/w/api.php?action=help&modules=managetags">managetags</a>, <a href="/w/api.php?action=help&modules=mergehistory">mergehistory</a>, <a href="/w/api.php?action=help&modules=mobileview">mobileview</a>, <a href="/w/api.php?action=help&modules=move">move</a>, <a href="/w/api.php?action=help&modules=opensearch">opensearch</a>, <a href="/w/api.php?action=help&modules=options">options</a>, <a href="/w/api.php?action=help&modules=paraminfo">paraminfo</a>, <a href="/w/api.php?action=help&modules=parse">parse</a>, <a href="/w/api.php?action=help&modules=patrol">patrol</a>, <a href="/w/api.php?action=help&modules=protect">protect</a>, <a href="/w/api.php?action=help&modules=purge">purge</a>, <a href="/w/api.php?action=help&modules=query">query</a>, <a href="/w/api.php?action=help&modules=removeauthenticationdata">removeauthenticationdata</a>, <a href="/w/api.php?action=help&modules=resetpassword">resetpassword</a>, <a href="/w/api.php?action=help&modules=revisiondelete">revisiondelete</a>, <a href="/w/api.php?action=help&modules=rollback">rollback</a>, <a href="/w/api.php?action=help&modules=rsd">rsd</a>, <a href="/w/api.php?action=help&modules=scribunto-console">scribunto-console</a>, <a href="/w/api.php?action=help&modules=setnotificationtimestamp">setnotificationtimestamp</a>, <a href="/w/api.php?action=help&modules=stashedit">stashedit</a>, <a href="/w/api.php?action=help&modules=tag">tag</a>, <a href="/w/api.php?action=help&modules=templatedata">templatedata</a>, <a href="/w/api.php?action=help&modules=tokens">tokens</a>, <a href="/w/api.php?action=help&modules=unblock">unblock</a>, <a href="/w/api.php?action=help&modules=undelete">undelete</a>, <a href="/w/api.php?action=help&modules=unlinkaccount">unlinkaccount</a>, <a href="/w/api.php?action=help&modules=upload">upload</a>, <a href="/w/api.php?action=help&modules=userrights">userrights</a>, <a href="/w/api.php?action=help&modules=visualeditor">visualeditor</a>, <a href="/w/api.php?action=help&modules=visualeditoredit">visualeditoredit</a>, <a href="/w/api.php?action=help&modules=watch">watch</a>
Default: help
format

The format of the output.

One of the following values: <a href="/w/api.php?action=help&modules=json">json</a>, <a href="/w/api.php?action=help&modules=jsonfm">jsonfm</a>, <a href="/w/api.php?action=help&modules=none">none</a>, <a href="/w/api.php?action=help&modules=php">php</a>, <a href="/w/api.php?action=help&modules=phpfm">phpfm</a>, <a href="/w/api.php?action=help&modules=rawfm">rawfm</a>, <a href="/w/api.php?action=help&modules=xml">xml</a>, <a href="/w/api.php?action=help&modules=xmlfm">xmlfm</a>
Default: jsonfm
maxlag

Maximum lag can be used when MediaWiki is installed on a database replicated cluster. To save actions causing any more site replication lag, this parameter can make the client wait until the replication lag is less than the specified value. In case of excessive lag, error code maxlag is returned with a message like Waiting for $host: $lag seconds lagged.
See <a href="http://www.mediawiki.org/wiki/Manual:Maxlag_parameter" class="extiw" title="mw:Manual:Maxlag parameter">Manual: Maxlag parameter</a> for more information.

Type: integer
smaxage

Set the s-maxage HTTP cache control header to this many seconds. Errors are never cached.

Type: integer
Default: 0
maxage

Set the max-age HTTP cache control header to this many seconds. Errors are never cached.

Type: integer
Default: 0
assert

Verify the user is logged in if set to user, or has the bot user right if bot.

One of the following values: user, bot
requestid

Any value given here will be included in the response. May be used to distinguish requests.

servedby

Include the hostname that served the request in the results.

Type: boolean (<a href="#main.2Fdatatypes">details</a>)
curtimestamp

Include the current timestamp in the result.

Type: boolean (<a href="#main.2Fdatatypes">details</a>)
origin

When accessing the API using a cross-domain AJAX request (CORS), set this to the originating domain. This must be included in any pre-flight request, and therefore must be part of the request URI (not the POST body). This must match one of the origins in the Origin header exactly, so it has to be set to something like <a rel="nofollow" class="external free" href="https://en.wikipedia.org">https://en.wikipedia.org</a> or <a rel="nofollow" class="external free" href="https://meta.wikimedia.org">https://meta.wikimedia.org</a>. If this parameter does not match the Origin header, a 403 response will be returned. If this parameter matches the Origin header and the origin is whitelisted, an Access-Control-Allow-Origin header will be set.

uselang

Language to use for message translations. <a href="/w/api.php?action=help&modules=query%2Bsiteinfo">action=query&meta=siteinfo</a> with siprop=languages returns a list of language codes, or specify user to use the current user's language preference, or specify content to use this wiki's content language.

Default: user
Examples:
Help for the main module.
<a href="/w/api.php?action=help">api.php?action=help</a> <a href="/Wiki/Special:ApiSandbox#action=help">[open in sandbox]</a>
All help in one page.
<a href="/w/api.php?action=help&recursivesubmodules=1">api.php?action=help&recursivesubmodules=1</a> <a href="/Wiki/Special:ApiSandbox#action=help&recursivesubmodules=1">[open in sandbox]</a>
Permissions:
writeapi
Use of the write API
Granted to: all, user, bot
apihighlimits
Use higher limits in API queries (slow queries: 500; fast queries: 5000). The limits for slow queries also apply to multivalue parameters.
Granted to: bot, sysop

Data types

Some parameter types in API requests need further explanation:

boolean
Boolean parameters work like HTML checkboxes: if the parameter is specified, regardless of value, it is considered true. For a false value, omit the parameter entirely.
timestamp
Timestamps may be specified in several formats. ISO 8601 date and time is recommended. All times are in UTC, any included timezone is ignored.
  • ISO 8601 date and time, 2001-01-15T14:56:00Z (punctuation and Z are optional)
  • ISO 8601 date and time with (ignored) fractional seconds, 2001-01-15T14:56:00.00001Z (dashes, colons, and Z are optional)
  • MediaWiki format, 20010115145600
  • Generic numeric format, 2001-01-15 14:56:00 (optional timezone of GMT, +##, or -## is ignored)
  • EXIF format, 2001:01:15 14:56:00
  • <a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc2822">RFC 2822</a> format (timezone may be omitted), Mon, 15 Jan 2001 14:56:00
  • <a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc850">RFC 850</a> format (timezone may be omitted), Monday, 15-Jan-2001 14:56:00
  • C ctime format, Mon Jan 15 14:56:00 2001
  • Seconds since 1970-01-01T00:00:00Z as a 1 to 13 digit integer (excluding 0)
  • The string now

Credits

API developers:

  • Yuri Astrakhan (creator, lead developer Sep 2006–Sep 2007)
  • Roan Kattouw (lead developer Sep 2007–2009)
  • Victor Vasiliev
  • Bryan Tong Minh
  • Sam Reed
  • Brad Jorsch (lead developer 2013–present)

Please send your comments, suggestions and questions to mediawiki-api@lists.wikimedia.org

or file a bug report at <a rel="nofollow" class="external free" href="https://phabricator.wikimedia.org/">https://phabricator.wikimedia.org/</a>.

<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.state({"user":"ready","user.groups":"ready"});mw.loader.load(["site","mediawiki.user","mediawiki.hidpi","mediawiki.page.ready","mediawiki.searchSuggest","ext.visualEditor.targetLoader"]);});</script><script>

 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
 })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 ga('create', 'UA-66156973-1', 'auto');
 ga('set', 'anonymizeIp', true);
 ga('send', 'pageview');

</script> <script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgBackendResponseTime":173});});</script> </body></html>

Navigation menu