API:Login/cs

MediaWiki API může vyžadovat, aby vaše aplikace nebo klient poskytla ověřené uživatelské přihlašovací údaje a přihlášení pro (a) dotazování na informace nebo akce upravující data (b) provádění velkých dotazů s vyšším limitem požadavku na jeden.



Dvě metody ověření
Existují dva způsoby, jak se ověřit na MediaWiki Action API:



1. metoda přihlášení
Boti a další neinteraktivní aplikace by měly používat, pokud jsou k dispozici, zákazníky OAuth pouze pro vlastníka protože je to bezpečnější. Pokud není k dispozici nebo se na klienta nevztahuje, lze akci  použít s hesly robotů.



Příklad


Odpověď


Ukázkový kód


Method 2. clientlogin
Interactive applications such as custom editors or patrolling applications that provide a service without intending to fully replace the website or mobile apps that aim to completely replace access to the web-based user interface should use the  action. However, one should prefer using if it is available for authenticating the tool, as it is easier and more secure. This module is available since MediaWiki 1.27.

POST request
Obtain token login in the request above via.

Example 2: Process for a wiki with special authentication extensions
A wiki with special authentication extensions such as (captchas),,  (two factor authentication), may have a more complicated authentication process. Specific fields might also be required in that case, the description of which could be fetched from the query.

Additional notes

 * On wikis that allow anonymous editing, it's possible to edit through the API without logging in, but it's highly recommended that you do log in. On private wikis, logging in is required to use any API functionality.
 * It is recommended to create a separate user account for your application. This is especially important if your application is carrying out automated editing or invoking large or performance-intensive queries. With that, it is easy to track changes made by the application and apply special rights to the application's account.
 * If you are sending a request that should be made by a logged-in user, add  parameter to the request you are sending in order to check whether the user is logged in. If the user is not logged-in, an   error code will be returned.
 * To check if an account has bot rights, add  parameter to the request. If the account does not have bot rights, an   error code will be returned.