From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page API:Assert and the translation is 40% complete.

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎magyar • ‎polski • ‎čeština • ‎русский • ‎ไทย • ‎中文 • ‎日本語 • ‎한국어
Versión de MediaWiki: 1.23

To make sure your bot doesn't edit while logged out, the action API provides an assert parameter which you can add to any request.

  • assert=user: Comprueba que tu cuenta tenga iniciada sesión
  • assert=bot: Comprueba que tu cuenta tiene bien el usuario "bot"

If the assertion fails, error codes of assertuserfailed or assertbotfailed will be returned.

Verificar si tu sesión está iniciada

If you simply want to check whether you are logged into the action API, you can issue a request with parameters action=query&assert=user. This will return a simple blank response ({} in the JSON format) if you are indeed logged in, or the assertuserfailed error if not.

Normalmente no deberás hacer esto. Instead, add the assert=user parameter to all requests that should be made by a logged-in user.