MediaWiki API súgó
Ez egy automatikusan generált MediaWiki-API-dokumentációs lap.
Dokumentáció és példák: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page
General information
Állapot: A MediaWiki API egy érett és stabil interfész, ami aktív támogatásban és fejlesztésben részesül. Bár próbáljuk elkerülni, de néha szükség van visszafelé nem kompatibilis változtatásokra; iratkozz fel a mediawiki-api-announce levelezőlistára a frissítések követéséhez.
Hibás kérések: Ha az API hibás kérést kap, egy HTTP-fejlécet küld vissza „MediaWiki-API-Error” kulccsal, és a fejléc értéke és a visszaküldött hibakód ugyanarra az értékre lesz állítva. További információért lásd: API: Hibák és figyelmeztetések.
Tesztelés: Az API-kérések könnyebb teszteléséhez használható az API-homokozó.
Request methods
Action API requests may use GET and POST methods. Prefer using the GET method, which allows requests to be routed to faster replica servers and responses to be cached, unless the length of the URL with parameters would exceed its length limit (commonly 8000 bytes), or a module only accepts POST requests.
Parameters for POST requests may be sent in the query part of the request URL (like in GET requests) and in the POST request body, and mixing both ways in one request is allowed. Certain parameters such as passwords must be sent in the request body. If the same parameter is sent as part of the URL and also in the request body, it must have the same value in both places.
Adattípusok
Input to MediaWiki should be NFC-normalized UTF-8. MediaWiki may attempt to convert other input, but this may cause some operations (such as edits with MD5 checks) to fail.
Parameters that take multiple values are normally submitted with the values separated using the pipe character, e.g. param=value1|value2 or param=value1%7Cvalue2. If a value must contain the pipe character, use U+001F (Unit Separator) as the separator and prefix the value with U+001F, e.g. param=%1Fvalue1%1Fvalue2.
Some parameter types in API requests need further explanation:
- boolean
A logikai paraméterek a HTML jelölőnégyzeteihez hasonlóan működnek: ha a paraméter meg van adva, az igazat jelent, függetlenül a paraméter értékétől. Hamis értékhez hagyd el a paramétert teljesen.
- expiry
Expiry values may be relative (e.g. 5 months or 2 weeks) or absolute (e.g. 2014-09-18T12:34:56Z). For no expiry, use infinite, indefinite, infinity or never.
- timestamp
Timestamps may be specified in several formats, see the Timestamp library input formats documented on mediawiki.org for details. ISO 8601 date and time is recommended: 2001-01-15T14:56:00Z. The string now may be used to specify the current time.
Limits
Most API modules can accept up to 50 inputs in multivalue parameters, and can return up to 500 results per query (50 results for slow queries).
For users with the apihighlimits right (botok és adminisztrátorok), the limits are increased to 500 inputs and 5 000 results (500 results for slow queries).
Templated parameters
Templated parameters support cases where an API module needs a value for each value of some other parameter. For example, if there were an API module to request fruit, it might have a parameter fruits to specify which fruits are being requested and a templated parameter {fruit}-quantity to specify how many of each fruit to request. An API client that wants 1 apple, 5 bananas, and 20 strawberries could then make a request like fruits=apples|bananas|strawberries&apples-quantity=1&bananas-quantity=5&strawberries-quantity=20.
Fő modul
- Forrás: MediaWiki
- Licenc: GPL-2.0-or-later
Specify the action to perform, the format of the response, and options that apply to all API modules.
- action
Milyen műveletet hajtson végre.
- abusefiltercheckmatch
- Check to see if an AbuseFilter matches a set of variables, an edit, or a logged AbuseFilter event.
- abusefilterchecksyntax
- Egy vandálszűrő szintaxisának ellenőrzése.
- abusefilterevalexpression
- Kiértékel egy Vandálszűrő kifejezést.
- abusefilterunblockautopromote
- Unblocks a user from receiving autopromotions due to an abusefilter consequence.
- abuselogprivatedetails
- View private details of an AbuseLog entry.
- acquiretempusername
- Acquire a temporary user username and stash it in the current session, if temp account creation is enabled and the current user is logged out. If a name has already been stashed, returns the same name.
- antispoof
- Check a username against AntiSpoof's normalisation checks.
- block
- Egy felhasználó blokkolása.
- centralauthtoken
- Fetch a centralauthtoken for making an authenticated request to an attached wiki.
- centralnoticecdncacheupdatebanner
- Request the purge of banner content stored in the CDN (front-end) cache for anonymous users, for the requested banner and language
- centralnoticechoicedata
- Get data needed to choose a banner for a given project and language
- centralnoticequerycampaign
- Get all configuration settings for a campaign.
- changeauthenticationdata
- Change authentication data for the current user.
- changecontentmodel
- Change the content model of a page
- checktoken
- Egy action=query&meta=tokens kéréssel szerzett token érvényességének vizsgálata.
- clearhasmsg
- A
hasmsgjelzés törlése az aktuális felhasználónak. - clientlogin
- Log in to the wiki using the interactive flow.
- communityconfigurationedit
- Change the content of a configuration provider in Community configuration
- compare
- Két lap közötti különbség kiszámítása.
- createaccount
- Új felhasználói fiók létrehozása.
- createlocalaccount
- Forcibly create a local account. The central account must exist.
- delete
- Lap törlése.
- deleteglobalaccount
- Delete a global user.
- discussiontoolsedit
- Üzenet elküldése egy vitalapra.
- discussiontoolsfindcomment
- Find a comment by its ID or name.
- discussiontoolsgetsubscriptions
- Adott témák feliratkozási állapotának lekérdezése.
- discussiontoolssubscribe
- Feliratkozás (vagy leiratkozás) egy adott téma értesítéseiről.
- discussiontoolsthank
- Send a public thank-you notification for a comment.
- echocreateevent
- Manually trigger a notification to a user
- echomarkread
- A jelenlegi felhasználó értesítéseinek olvasottnak jelölése.
- echomarkseen
- Értesítések látottnak jelölése az aktuális felhasználó számára.
- echomute
- Értesítések némítása vagy engedélyezése bizonyos felhasználóktól vagy bizonyos lapokhoz kapcsolódóan.
- edit
- Lapok létrehozása és szerkesztése.
- editmassmessagelist
- Edit a mass message delivery list.
- emailuser
- E-mail küldése
- expandtemplates
- Minden sablon kibontása a wikiszövegben.
- featuredfeed
- Returns a featured content feed.
- feedcontributions
- Egy felhasználó közreműködéseinek lekérése hírcsatornaként.
- feedrecentchanges
- A friss változtatások lekérése hírcsatornaként.
- feedwatchlist
- A figyelőlista lekérése hírcsatornaként.
- filerevert
- Egy fájl visszaállítása egy régebbi verzióra.
- globalblock
- Egy felhasználó globális blokkolása vagy blokkjának feloldása.
- globalpreferenceoverrides
- Change local overrides for global preferences for the current user.
- globalpreferences
- Change global preferences of the current user.
- globaluserrights
- Add/remove a user to/from global groups.
- help
- Súgó megjelenítése a megadott modulokhoz.
- imagerotate
- Ez a modul le lett tiltva.
- import
- Egy lap importálása egy másik wikiből vagy XML-fájlból.
- jsonconfig
- Közvetlen hozzáférés a JsonConfig alrendszerhez.
- languagesearch
- Nyelvnevek keresése bármilyen írásrendszerrel.
- linkaccount
- Egy harmadik fél szolgáltató fiókjának kapcsolása a jelenlegi felhasználóhoz.
- login
- Bejelentkezés és hitelesítő sütik lekérése.
- logout
- Kijelentkezés és munkamenetadatok törlése.
- managetags
- A változtatáscímkék kezelése.
- massmessage
- Send a message to a list of pages.
- mergehistory
- Laptörténetek egyesítése
- move
- Egy lap átnevezése.
- opensearch
- Keresés a wikin az OpenSearch protokoll segítségével.
- options
- A jelenlegi felhasználó beállításainak módosítása.
- paraminfo
- Információk lekérése API-modulokról.
- parse
- Tartalom feldolgozása.
- patrol
- Egy lap vagy lapváltozat ellenőrzöttnek jelölése (patrol).
- protect
- Egy lap védelmi szintjének változtatása.
- purge
- A gyorsítótár ürítése a megadott lapoknál.
- query
- Adatok lekérése a MediaWikiből és a MediaWikiről.
- removeauthenticationdata
- A jelenlegi felhasználó hitelesítési adatainak eltávolítása.
- resetpassword
- Jelszó-visszaállító e-mail küldése a felhasználónak.
- revisiondelete
- Változatok törlése és helyreállítása.
- rollback
- A lap legutóbbi változtatásának visszavonása.
- rsd
- Egy RSD-séma (Really Simple Discovery) exportálása.
- setglobalaccountstatus
- Hide or lock (or unhide or unlock) a global user account.
- setnotificationtimestamp
- A figyelt lapok értesítési időbélyegének frissítése.
- setpagelanguage
- Egy lap nyelvének módosítása.
- shortenurl
- Egy hosszú URL rövidítése.
- sitematrix
- Get Wikimedia sites list.
- spamblacklist
- Validate one or more URLs against the spam block list.
- streamconfigs
- Exposes event stream config. Returns only format=json with formatversion=2.
- strikevote
- Allows admins to strike or unstrike a vote.
- tag
- Add or remove change tags from individual revisions or log entries.
- templatedata
- A TemplateData kiterjesztés által tárolt adatok lekérdezése.
- thank
- Köszönet küldése egy szerkesztőnek.
- titleblacklist
- Validate a page title, filename, or username against the TitleBlacklist.
- torblock
- Check if an IP address is blocked as a Tor exit node.
- transcodereset
- Users with the 'transcode-reset' right can reset and re-run a transcode job.
- unblock
- Unblock a user.
- undelete
- Undelete revisions of a deleted page.
- unlinkaccount
- Remove a linked third-party account from the current user.
- upload
- Upload a file, or get the status of pending uploads.
- userrights
- Change a user's group membership.
- validatepassword
- Validate a password against the wiki's password policies.
- watch
- Add or remove pages from the current user's watchlist.
- webapp-manifest
- Returns a webapp manifest.
- webauthn
- API Module to communicate between server and client during registration/authentication process.
- bouncehandler
- Belső. Receive a bounce email and process it to handle the failing recipient.
- categorytree
- Belső. A CategoryTree kiterjesztés belső modulja.
- chartinfo
- Belső. Retrieve current count of how many unique Chart page usages there are. Multiple uses of the same chart on the same page are considered a single use.
- cirrus-check-sanity
- Belső. Reports on the correctness of a range of page ids in the search index
- cirrus-config-dump
- Belső. Dump of CirrusSearch configuration.
- cirrus-profiles-dump
- Belső. Dump of CirrusSearch profiles for this wiki.
- cirrus-schema-dump
- Belső. Dump of CirrusSearch schema (settings and mappings) for this wiki.
- codemirror-validate
- Belső. Check for validation errors in the given content
- collection
- Belső. API module for performing various operations on a wiki user's collection.
- cspreport
- Belső. Used by browsers to report violations of the Content Security Policy. This module should never be used, except when used automatically by a CSP compliant web browser.
- discussiontoolscompare
- Belső. Információk lekérése két lapváltozat közötti hozzászólás-változásokról.
- discussiontoolspageinfo
- Belső. A megbeszéléseszközök inicializálásához szükséges metaadatok lekérése.
- discussiontoolspreview
- Belső. Egy üzenet előnézetének megjelenítése egy vitalapon.
- editcheckreferenceurl
- Belső. Check the status of a URL for use as a reference.
- fancycaptchareload
- Belső. Get a new FancyCaptcha.
- jsondata
- Belső. Lokalizált JSON-adatok lekérése.
- jsontransform
- Belső. Retrieve JSON data transformed by a Lua function.
- parser-migration
- Belső. Parse a page with two different parser configurations.
- readinglists
- Belső. Reading list write operations.
- sanitize-mapdata
- Belső. Performs data validation for Kartographer extension
- scribunto-console
- Belső. Belső modul a Scribunto konzolról érkező XHR-kérések kiszolgálására.
- securepollauth
- Belső. Allows a remote wiki to authenticate users before granting access to vote in the election.
- stashedit
- Belső. Egy szerkesztés előkészítése a megosztott gyorsítótárban.
- timedtext
- Belső. Provides timed text content for usage by <track> elements
- ulslocalization
- Belső. Az ULS fordításának lekérése egy adott nyelven.
- ulssetlang
- Belső. Update user's preferred interface language.
- visualeditor
- Belső. A Parsoid szolgáltatástól kapott oldalból HTML5 oldalt készít.
- visualeditoredit
- Belső. HTML5 oldal elmentése a wikiben (a Parsoid szolgáltatással wikiszöveggé konvertálva).
- wikimediaeventsblockededit
- Belső. Log information about blocked edit attempts
- wikimediaeventshcaptchaeditattempt
- Belső. Log edit diff when hCaptcha challenge is shown but edit is incomplete
- A következő értékek egyike: abusefiltercheckmatch, abusefilterchecksyntax, abusefilterevalexpression, abusefilterunblockautopromote, abuselogprivatedetails, acquiretempusername, antispoof, block, centralauthtoken, centralnoticecdncacheupdatebanner, centralnoticechoicedata, centralnoticequerycampaign, changeauthenticationdata, changecontentmodel, checktoken, clearhasmsg, clientlogin, communityconfigurationedit, compare, createaccount, createlocalaccount, delete, deleteglobalaccount, discussiontoolsedit, discussiontoolsfindcomment, discussiontoolsgetsubscriptions, discussiontoolssubscribe, discussiontoolsthank, echocreateevent, echomarkread, echomarkseen, echomute, edit, editmassmessagelist, emailuser, expandtemplates, featuredfeed, feedcontributions, feedrecentchanges, feedwatchlist, filerevert, globalblock, globalpreferenceoverrides, globalpreferences, globaluserrights, help, imagerotate, import, jsonconfig, languagesearch, linkaccount, login, logout, managetags, massmessage, mergehistory, move, opensearch, options, paraminfo, parse, patrol, protect, purge, query, removeauthenticationdata, resetpassword, revisiondelete, rollback, rsd, setglobalaccountstatus, setnotificationtimestamp, setpagelanguage, shortenurl, sitematrix, spamblacklist, streamconfigs, strikevote, tag, templatedata, thank, titleblacklist, torblock, transcodereset, unblock, undelete, unlinkaccount, upload, userrights, validatepassword, watch, webapp-manifest, webauthn, bouncehandler, categorytree, chartinfo, cirrus-check-sanity, cirrus-config-dump, cirrus-profiles-dump, cirrus-schema-dump, codemirror-validate, collection, cspreport, discussiontoolscompare, discussiontoolspageinfo, discussiontoolspreview, editcheckreferenceurl, fancycaptchareload, jsondata, jsontransform, parser-migration, readinglists, sanitize-mapdata, scribunto-console, securepollauth, stashedit, timedtext, ulslocalization, ulssetlang, visualeditor, visualeditoredit, wikimediaeventsblockededit, wikimediaeventshcaptchaeditattempt
- Alapértelmezett: help
- format
A kimenet formátuma.
- A következő értékek egyike: json, jsonfm, none, rawfm, xml, xmlfm
- Alapértelmezett: 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 Manual: Maxlag parameter for more information.- Típus: egész szám
- smaxage
Az
s-maxagegyorsítótár-vezérlő HTTP-fejléc beállítása ennyi másodpercre. A hibák soha nincsenek gyorsítótárazva.- Típus: egész szám
- Az érték nem lehet kisebb mint 0.
- Alapértelmezett: 0
- maxage
Az
maxagegyorsítótár-vezérlő HTTP-fejléc beállítása ennyi másodpercre. A hibák soha nincsenek gyorsítótárazva.- Típus: egész szám
- Az érték nem lehet kisebb mint 0.
- Alapértelmezett: 0
- assert
Annak ellenőrzése, hogy a felhasználó be van-e jelentkezve (akár egy ideiglenes felhasználóval) user érték esetén, illetve ki van-e jelentkezve anon esetén, vagy botjog ellenőrzése bot érték esetén.
- A következő értékek egyike: anon, bot, user
- assertuser
Annak ellenőrzése, hogy a jelenlegi felhasználó a megadott-e.
- Típus: felhasználó, a következők egyikével megadva: felhasználónév és Ideiglenes felhasználó
- requestid
Az itt megadott bármilyen érték szerepelni fog a válaszban. Több kérés megkülönböztetésére használható.
- servedby
Tartalmazza a válasz kérést kiszolgáló gép nevét.
- Típus: logikai (részletek)
- curtimestamp
Tartalmazza a válasz az aktuális időbélyeget.
- Típus: logikai (részletek)
- responselanginfo
A válasz tartalmazza uselang és errorlang paraméterekben használt nyelveket.
- Típus: logikai (részletek)
- 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 URL (not the POST body).
For authenticated requests, this must match one of the origins in the
Originheader exactly, so it has to be set to something like https://en.wikipedia.org or https://meta.wikimedia.org. If this parameter does not match theOriginheader, a 403 response will be returned. If this parameter matches theOriginheader and the origin is allowed, theAccess-Control-Allow-OriginandAccess-Control-Allow-Credentialsheaders will be set.For non-authenticated requests, specify the value *. This will cause the
Access-Control-Allow-Originheader to be set, butAccess-Control-Allow-Credentialswill befalseand all user-specific data will be restricted.- crossorigin
When accessing the API using a cross-domain AJAX request (CORS) and using a session provider that is safe against cross-site request forgery (CSRF) attacks (such as OAuth), use this instead of
origin=*to make the request authenticated (i.e., not logged out). This must be included in any pre-flight request, and therefore must be part of the request URL (not the POST body).Note that most session providers, including standard cookie-based sessions, do not support authenticated CORS and cannot be used with this parameter.
- Típus: logikai (részletek)
- uselang
Az üzenetfordításokhoz használandó nyelv (az action=query&meta=siteinfo&siprop=languages visszaadja a lehetséges nyelvkódok listáját), vagy user az aktuális felhasználó, illetve content a wiki nyelvbeállításához.
- Alapértelmezett: user
- variant
Variant of the language. Only works if the base language supports variant conversion.
- errorformat
A figyelmeztetések és hibaüzenetek formátuma
- plaintext
- Wikiszöveg eltávolított HTML-címkékkel és a HTML-entitások (pl. &) kicserélésével.
- wikitext
- Feldolgozatlan wikiszöveg.
- html
- HTML
- raw
- Az üzenet azonosítója és paraméterei.
- none
- Szöveges kimenet mellőzése, csak hibakódok.
- bc
- A MediaWiki 1.29 előtti formátum. A errorlang és erroruselocal paraméterek figyelmen kívül lesznek hagyva.
- A következő értékek egyike: bc, html, none, plaintext, raw, wikitext
- Alapértelmezett: bc
- errorlang
A figyelmeztetésekhez és hibaüzenetekhez használandó nyelv (az action=query&meta=siteinfo&siprop=languages visszaadja a lehetséges nyelvkódok listáját), vagy content a wiki nyelvbeállításához, illetve uselang a uselang paraméter értékéhez.
- Alapértelmezett: uselang
- errorsuselocal
Ha meg van adva, a hibaüzenetek a helyileg testreszabott üzeneteket fogják használni a MediaWiki névtérből.
- Típus: logikai (részletek)
- centralauthtoken
When accessing the API using a cross-domain AJAX request (CORS), use this to authenticate as the current SUL user. Use action=centralauthtoken on this wiki to retrieve the token, before making the CORS request. Each token may only be used once, and expires after 60 seconds. This should be included in any pre-flight request, and therefore should be included in the request URI (not the POST body).
On this wiki the expected value is a JSON Web Token, which may be validated by proxy servers in front of MediaWiki. If the token has expired or is otherwise invalid, you may receive a HTTP error from a proxy in a different format than a normal API error.
- Súgó megjelenítése a fő modulhoz.
- api.php?action=help [megnyitás a homokozóban]
- Minden súgó egy lapon.
- api.php?action=help&recursivesubmodules=1&toc [megnyitás a homokozóban]
Készítők
API-fejlesztők:
- Jurij Asztrahan (készítő, vezető fejlesztő 2006 szeptemberétől 2007 szeptemberéig)
- Roan Kattouw (vezető fejlesztő 2007 szeptemberétől 2009-ig)
- Viktor Vasziljev
- Bryan Tong Minh
- Sam Reed
- Brad Jorsch (vezető fejlesztő 2013-tól 2020-ig)
A megjegyzéseidet, javaslataidat és kérdéseidet a mediawiki-api@lists.wikimedia.org címre küldheted, vagy készíthetsz egy hibajelentést a https://phabricator.wikimedia.org/ oldalon.
