Pomoć oko Medijavikijevog API-ja
Ovo je automatski generisana dokumentacija za Medijaviki API
Dokumentacija i primeri: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page
Glavni modul
- Izvor: MediaWiki
- Licenca: GPL-2.0-or-later
Status: The MediaWiki API is a mature and stable interface that is actively supported and improved. While we try to avoid it, we may occasionally need to make breaking changes; subscribe to the mediawiki-api-announce mailing list 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 API: Errors and warnings.
Testing: For ease of testing API requests, see Special:ApiSandbox.
- action
Koju akciju izvesti.
- abusefiltercheckmatch
- Provjerite nalazi li filter za zlouporabu određeni skup varijabli, uređivanje ili zapisan događaj u filteru.
- abusefilterchecksyntax
- Provjeri sintaksu danog filtra zlostavljanja.
- abusefilterevalexpression
- Ocjenjuje izraz u Filtru za zloupotrebe.
- abusefilterunblockautopromote
- Uklanja blok na autounapređivanje određenog korisnika, dobiven zbog posljedice filtra za zlouporabu.
- abuselogprivatedetails
- Pregled osobnih podataka za unos u Evidenciji zloupotreba.
- 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
- Provjerite ga korisničko ime uz provjeru normalizacije AntiSpoof.
- block
- Blokiraj korisnika.
- centralauthtoken
- Fetch a centralauthtoken for making an authenticated request to an attached wiki.
- centralnoticecdncacheupdatebanner
- Zahtjev za čištenje sadržaja pohranjenog u CDN (front-end) predmemoriji za anonimne korisnike, za traženu obavijest i jezik
- 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
- Check the validity of a token from action=query&meta=tokens.
- cirrus-config-dump
- Rezervno spremište postavki CirrusSearcha.
- cirrus-mapping-dump
- Rezervno spremište sličivanja CirrusSearcha za ovaj wiki.
- cirrus-profiles-dump
- Rezervno spremište profila CirrusSearcha za ovaj wiki.
- cirrus-settings-dump
- Rezervno spremište postavki CirrusSearcha za ovaj wiki.
- clearhasmsg
- Clears the
hasmsg
flag for the current user. - clientlogin
- Log in to the wiki using the interactive flow.
- compare
- Get the difference between two pages.
- createaccount
- Napravi novi korisnički račun.
- createlocalaccount
- Forcibly create a local account. The central account must exist.
- delete
- Obriši stranicu.
- deleteglobalaccount
- Brisanje globalnog korisnika.
- discussiontoolsedit
- Objavljivanje poruke na stranici za diskusiju.
- discussiontoolsfindcomment
- Find a comment by its ID or name.
- discussiontoolsgetsubscriptions
- Get the subscription statuses of given topics.
- discussiontoolssubscribe
- Subscribe (or unsubscribe) to receive notifications about a topic.
- echomarkread
- Označi sva obavještenja kao pročitana za trenutni korisnik.
- echomarkseen
- Označi obavještenja kao pročitana za trenutni korisnik.
- echomute
- Mute or unmute notifications from certain users or pages.
- edit
- Pravi i uređuj stranice.
- editmassmessagelist
- Edit a mass message delivery list.
- emailuser
- Pošalji e-poruku korisniku.
- expandtemplates
- Expands all templates within wikitext.
- featuredfeed
- Daje dovod s izabranim sadržajem.
- feedcontributions
- Returns a user's contributions feed.
- feedrecentchanges
- Returns a recent changes feed.
- feedwatchlist
- Returns a watchlist feed.
- filerevert
- Vraćanje datoteke na staru verziju.
- globalblock
- Globalno blokirajte ili odblokirajte korisnika.
- globalpreferenceoverrides
- Change local overrides for global preferences for the current user.
- globalpreferences
- Promena globalnih podešavanja trenutnog korisnika.
- globaluserrights
- Dodaj/ukloni korisnika u/iz globalne grupe.
- help
- Display help for the specified modules.
- imagerotate
- Modul je deaktiviran.
- import
- Import a page from another wiki, or from an XML file.
- jsonconfig
- Omogućuje izravan pristup podsustavu JsonConfig.
- languagesearch
- Pretražite jezike na bilo kom pismu.
- linkaccount
- Link an account from a third-party provider to the current user.
- login
- Log in and get authentication cookies.
- logout
- Log out and clear session data.
- managetags
- Perform management tasks relating to change tags.
- massmessage
- Send a message to a list of pages.
- mergehistory
- Merge page histories.
- move
- Premeštanje stranice.
- opensearch
- Search the wiki using the OpenSearch protocol.
- options
- Change preferences of the current user.
- paraminfo
- Obtain information about API modules.
- parse
- Parses content and returns parser output.
- patrol
- Patrol a page or revision.
- protect
- Change the protection level of a page.
- purge
- Purge the cache for the given titles.
- query
- Fetch data from and about MediaWiki.
- removeauthenticationdata
- Remove authentication data for the current user.
- resetpassword
- Send a password reset email to a user.
- revisiondelete
- Delete and undelete revisions.
- rollback
- Undo the last edit to the page.
- rsd
- Export an RSD (Really Simple Discovery) schema.
- setglobalaccountstatus
- Postavi status globalnog korisnika.
- setnotificationtimestamp
- Update the notification timestamp for watched pages.
- setpagelanguage
- Change the language of a page.
- shortenurl
- Skraćivanje dugačke URL-e u kraćem obliku.
- sitematrix
- Daje spisak Wikimedijinih wikija.
- spamblacklist
- Validate one or more URLs against the spam block list.
- streamconfigs
- Izlaže konfiguraciju toka događaja. Vraća samo format=json s formatversion=2.
- strikevote
- Administratorima omogućuje precrtavanje ili obnavljanje glasanja.
- tag
- Add or remove change tags from individual revisions or log entries.
- templatedata
- Pribavljanje podataka koje je TemplateData proširenje sačuvalo.
- thank
- Pošalji obavijest o zahvali uređivaču.
- 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
- Deblokiranje korisnika.
- 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
- Daje manifest web privitka.
- webauthn
- API Module to communicate between server and client during registration/authentication process.
- bouncehandler
- Internal. Pošalji povratne informacije putem e-pošte da bi obrada mogla raditi s neuspješnim upisom.
- categorytree
- Internal. Interni modul proširenja "Stablo kategorija".
- cirrus-check-sanity
- Internal. Reports on the correctness of a range of page ids in the search index
- collection
- Internal. Priložnički modul za izvođenje raznih radnji nad zbirkom wiki korisnika.
- cspreport
- Internal. 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
- Internal. Nabavi informacije o promjenama komentara između dvije izmjene stranice.
- discussiontoolspageinfo
- Internal. Prikazuje metapodatke potrebne za pokretanje alata za razgovor.
- discussiontoolspreview
- Internal. Preview a message on a discussion page.
- editcheckreferenceurl
- Internal. Check the status of a URL for use as a reference.
- fancycaptchareload
- Internal. Daj novu FancyCaptcha.
- jsondata
- Internal. Retrieve localized JSON data.
- oathvalidate
- Internal. Provjeri žeton za dvočiniteljsku potvrdu (OATH).
- parser-migration
- Internal. Raščlani stranice sa različitim urednim postavljenostima.
- readinglists
- Internal. Reading list write operations.
- sanitize-mapdata
- Internal. Izvršava proveru valjanosti podataka za dodatak „Kartograf”
- scribunto-console
- Internal. Internal module for servicing XHR requests from the Scribunto console.
- securepollauth
- Internal. Allows a remote wiki to authenticate users before granting access to vote in the election.
- stashedit
- Internal. Prepare an edit in shared cache.
- timedtext
- Internal. Provides timed text content for usage by <track> elements
- ulslocalization
- Internal. Get the localization of ULS in the given language.
- ulssetlang
- Internal. Update user's preferred interface language.
- visualeditor
- Internal. Vraća HTML5 za stranicu sa servisa Parsoid.
- visualeditoredit
- Internal. Snimite HTML5-stranicu u MediaWiki (pretvara se u wikitekst preko servisa Parsoid).
- wikimediaeventsblockededit
- Internal. Log information about blocked edit attempts
- One of the following values: abusefiltercheckmatch, abusefilterchecksyntax, abusefilterevalexpression, abusefilterunblockautopromote, abuselogprivatedetails, acquiretempusername, antispoof, block, centralauthtoken, centralnoticecdncacheupdatebanner, centralnoticechoicedata, centralnoticequerycampaign, changeauthenticationdata, changecontentmodel, checktoken, cirrus-config-dump, cirrus-mapping-dump, cirrus-profiles-dump, cirrus-settings-dump, clearhasmsg, clientlogin, compare, createaccount, createlocalaccount, delete, deleteglobalaccount, discussiontoolsedit, discussiontoolsfindcomment, discussiontoolsgetsubscriptions, discussiontoolssubscribe, 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, cirrus-check-sanity, collection, cspreport, discussiontoolscompare, discussiontoolspageinfo, discussiontoolspreview, editcheckreferenceurl, fancycaptchareload, jsondata, oathvalidate, parser-migration, readinglists, sanitize-mapdata, scribunto-console, securepollauth, stashedit, timedtext, ulslocalization, ulssetlang, visualeditor, visualeditoredit, wikimediaeventsblockededit
- Default: help
- format
Format izlaza.
- json
- Output data in JSON format.
- jsonfm
- Output data in JSON format (pretty-print in HTML).
- none
- Output nothing.
- php
- Output data in serialized PHP format.
- phpfm
- Output data in serialized PHP format (pretty-print in HTML).
- rawfm
- Output data, including debugging elements, in JSON format (pretty-print in HTML).
- xml
- Output data in XML format.
- xmlfm
- Output data in XML format (pretty-print in HTML).
- One of the following values: json, jsonfm, none, php, phpfm, rawfm, xml, xmlfm
- Default: jsonfm
- maxlag
Maksimalno kašnjenje može se koristiti kada je Medijaviki instaliran na replikovani klaster baze podataka. Da bi se sačuvalo od radnja koje će izazvati još kašnjenja usled replikacije sajta, ovaj parametar može da učini da klijent čeka dok kašnjenje zbog replikacije ne bude manje od određene vrednosti. U slučaju prekomernih kašnjenja, kod greške maxlag biva vraćen sa porukom kao što je Waiting for $host: $lag seconds lagged.
Pogledajte Priručnik: parametar Maxlag za više informacija.- Type: integer
- smaxage
Set the
s-maxage
HTTP cache control header to this many seconds. Errors are never cached.- Type: integer
- The value must be no less than 0.
- Default: 0
- maxage
Set the
max-age
HTTP cache control header to this many seconds. Errors are never cached.- Type: integer
- The value must be no less than 0.
- Default: 0
- assert
Verify that the user is logged in (including possibly as a temporary user) if set to user, not logged in if set to anon, or has the bot user right if bot.
- One of the following values: anon, bot, user
- assertuser
Verify the current user is the named user.
- Tip: korisnik, po: korisničko ime i Privremeni korisnik
- 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 (details)
- curtimestamp
Include the current timestamp in the result.
- Type: boolean (details)
- responselanginfo
Include the languages used for uselang and errorlang in the result.
- Type: boolean (details)
- 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).
For authenticated requests, this must match one of the origins in the
Origin
header 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 theOrigin
header, a 403 response will be returned. If this parameter matches theOrigin
header and the origin is allowed, theAccess-Control-Allow-Origin
andAccess-Control-Allow-Credentials
headers will be set.For non-authenticated requests, specify the value *. This will cause the
Access-Control-Allow-Origin
header to be set, butAccess-Control-Allow-Credentials
will befalse
and all user-specific data will be restricted.- uselang
Language to use for message translations. action=query&meta=siteinfo&siprop=languages returns a list of language codes. You can specify user to use the current user's language preference or content to use this wiki's content language.
- Default: user
- variant
Variant of the language. Only works if the base language supports variant conversion.
- errorformat
Format to use for warning and error text output
- plaintext
- Wikitext with HTML tags removed and entities replaced.
- wikitext
- Unparsed wikitext.
- html
- HTML
- raw
- Message key and parameters.
- none
- No text output, only the error codes.
- bc
- Format used prior to MediaWiki 1.29. errorlang and errorsuselocal are ignored.
- One of the following values: bc, html, none, plaintext, raw, wikitext
- Default: bc
- errorlang
Language to use for warnings and errors. action=query&meta=siteinfo&siprop=languages returns a list of language codes. Specify content to use this wiki's content language or uselang to use the same value as the uselang parameter.
- Default: uselang
- errorsuselocal
If given, error texts will use locally-customized messages from the MediaWiki namespace.
- Type: boolean (details)
- centralauthtoken
Kada pristupate privitku pomoću AJAX zahtjeva između domena (CORS), koristite ovo za legitimaciju kao trenutni korisnik s jedinstvenom prijavom. Upotrijebite action=centralauthtoken na ovom wikiju da dohvatite token prije postavljanja zahtjeva. Svaki token može se koristiti samo jednom, a istječe nakon 10 sekundi. Ovo bi trebalo biti uključeno u bilo koji predzahtjev, i stoga bi trebalo biti uključeno u URI zahtjeva (ne u POST tijelo).
- Pomoć za glavni modul.
- api.php?action=help [open in sandbox]
- Sva pomoć u jednoj stranici.
- api.php?action=help&recursivesubmodules=1 [open in sandbox]
Tipovi podataka
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
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.
- 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. Additionally, the string now may be used to specify the current timestamp.
Parametri šablona
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.
Zasluge
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–2020)
Please send your comments, suggestions and questions to mediawiki-api@lists.wikimedia.org or file a bug report at https://phabricator.wikimedia.org/.