API:FAQ/de

Überblick
This page provides answers to some frequently asked questions about the MediaWiki Action API.

Lies auch die. Sie beantwortet ein paar Fragen, die hier nicht beantwortet werden und verweist auf andere nützliche Seiten.

What is an API?
An API is an acronym for Application Programming Interface. It allows different applications to communicate with each other. In general terms, it refers to web-based APIs, which use HTTP requests-response mechanism and produce JSON/XML structured data.

Was ist eine REST API?
REST is an acronym for REpresentational State Transfer. A set of guiding principles or constraints define a RESTful system. A RESTful API &mdash; or just a REST API &mdash; adheres to these principles and hence is a faster, more reliable and scalable service.

Was kann eine API tun?
See some uses of API.

Wo kann ich mehr über APIs erfahren?
Here are a few resources:


 * Understanding APIs
 * An Introduction to API’s
 * What is REST — A Simple Explanation for Beginners, Part 1: Introduction

What is the MediaWiki Action API?
The MediaWiki Action API is a RESTful  web service that allows users to perform certain wiki-actions like page creation, authentication, parsing, searching, etc.

Wozu kann die MediaWiki Action API verwendet werden?
The MediaWiki Action API can be used to:


 * access wiki features.
 * interact with a wiki.
 * obtain meta-information about wikis and public users.

The right sidebar points to many features supported by the API. Also, see some Wikimedia projects that use the MediaWiki Action API.

Wie kann ich die MediaWiki Action API verwenden?
HTTP requests are usually used to call the Action API. For detailed instructions, read the tutorial.

API ausprobieren


 * verwende die Special:ApiSandbox
 * Enable your browser's developer console and watch net requests to  as you interact with the wiki.

Was sind ein Modul, ein Submodul und ein Parameter?
The MediaWiki Action API has numerous modules that we use to perform different tasks. In technical terms, a module is a subclass of ApiBase. A module requires parameters. These parameters may (or may not) be submodules.

Consider the following request: here:


 * is a parameter of the main module.
 * is another module. It is called the query module.
 * is a parameter of the query module.
 * is also a module. It can be called a submodule of.
 * is a parameter of the search module. It holds the search string 'abc'.
 * is a parameter of the main module.
 * is the output format.

Also, see Introduction and guidelines. It describes the submodules of the  module.

Woher weiß ich, welches Modul und Submodul ich anrufen soll?
Die MediaWiki Action API ist groß und Erweiterungen vergrößern sie noch weiter. Hier sind einige Möglichkeiten, um deine API-Abfrage zu erarbeiten:


 * In the sidebar, look for the feature you wish to implement and follow the link for information about which modules to call.
 * The self-documenting API pages contain a list of all modules and submodules with brief descriptions. You can start at the main module and follow the links to different submodules. (Append  to view the expanded version)

Wo kann ich einfache Beispielcodes zur Nutzung der API-Module finden?
The API documentation pages contain an 'Examples' section to demonstrate how different modules and submodules can be used. The auto-generated docs also have examples trailing the module descriptions.

See Mediawiki-API-demos for code snippets in Python and JavaScript.

Wie kann ich das Ausgabeformat kontrollieren?
The default output format is JSON. Other output formats have been deprecated or removed in the latest stable MediaWiki version, and their use is discouraged.

In older versions, to control the output format, you can pass  in the query string.

For information, see API:Data_formats.

Brauche ich ein Zugangs-Token?
You will require an access token to perform data modifying actions like logging in, editing, moving pages, etc.

To learn more, refer to API:Tokens or the sidebar category 'Authentication'.

Wie stelle ich über die API seitenübergreifende Abfragen?
You must use JSONP or CORS to make cross-site requests in MediaWiki.

For details, see API:Cross-site_requests.

Gibt es eine Begrenzung für Abfrageergebnisse?
Yes, it depends on the query parameter. For example, the results for  and   queries cannot exceed 500 for regular users. The API pages contain information about these limits in the 'Additional notes' section or the 'Limits' section. Note that some modules impose stricter limits under certain conditions.

If you are unsure about what limit to set and just want as many results as possible, set the limit to.

Gibt es ein Limit für API-Abfragen?
There is no concrete limit. Yet, we recommend making a reasonable number of calls to prevent getting blocked. If you want to make many requests, contact the administrators beforehand.

Also, see API:Etiquette.

Wo kann ich die Neuigkeiten über die MediaWiki Action API erfahren?
You can subscribe to the MediaWiki-API-Announce mailing list for announcements and updates.

Was sind Wiki-Dumbs und wie kann ich mit ihnen arbeiten?
Wikimedia’s data dumps are dumps of wiki collections, content, metadata, search indices, etc. To work with dumps, see using dumps and public dumps.

Wo kann ich mehr Hilfe erhalten?
If you can't find answers in the MediaWiki API documentation or the auto-generated documentation pages, feel free to reach out in the following ways.
 * Erstelle einen Wikimedia-Account (wenn Du noch keinen besitzt) und füge ein neues Thema zur API-Diskussionsseite hinzu.
 * Ask your question on:
 * IRC in the channel on the Freenode network.
 * MediaWiki-API mailing list.

How can I create an API module in an extension?
API:Extensions will walk you through the complete process of creating an API module in an extension.

Wie ist die interne Struktur der API?
API:Implementation_Strategy explains the implementation of the API machinery in MediaWiki Core.

Wie kann ich die Nutzung der API einschränken?
To restrict the API usage, you can either restrict the use of write API or disable individual modules.

For instructions and examples, see API:Restricting_API_usage.

Wie kann ich Benutzern erlauben/verbieten, über die API den Inhalt des Wikis zu verändern?
In MediaWiki 1.14, users are allowed to modify the wiki content by default. To restrict, you have to set  in.

In MediaWiki 1.13 or earlier, you have to enable the write API with  to allow content modification.

For more information, see API:Changing_wiki_content.

How do I detect an error?
If you encounter an error, the error response from the API will set the  HTTP header and return an error structure.

Was bedeutet dieser Fehler?
Find your error in the list of standard error messages to understand what the error means.

Wie erstelle ich eine Fehler-/ Funktionsanfrage?
You can report bugs and file feature requests on Wikimedia's task tracking tool, Phabricator.

Note:
 * Add the MediaWiki-API project tag to your task.
 * If your report/request is offered by an extension, add that extension's project. (e.g. MediaWiki-extensions-AbuseFilter,  MediaWiki-extensions-FlaggedRevs, etc.)
 * Verify for duplicates before creating a new task.
 * Understand the task creation terms on Phabricator before proceeding.

See How to report a bug for more details.

Am I facing errors due to my API version?
If a website runs a different version of MediaWiki, it would also run a different version of the API. Some module parameters supported in one version might be deprecated (or removed) in others. Such parameters will throw an exception if used. The API pages document any such deprecations.

See the release notes for information regarding different API versions.