API:Assert

The action API provides some parameters which you can add to any request to verify certain conditions before the API request is served.

The available parameters are:


 *  : Checks that you are not using a user account
 *  : Checks that you are using a user account
 *  : Checks that your account has the "bot" user right
 *  : Checks that your account is the expected user

Note that  will also fail, and   will also succeed, for temporary users.

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

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

Normally, you will not need to do this. Instead, add the  parameter to all requests that should be made by a logged-in user.