API:Userinfo

From MediaWiki.org
Jump to: navigation, search

Returns information about the currently logged-in user. The code for the userinfo function is located at ApiQueryUserInfo.php.

Parameters[edit]

  • uiprop: Which properties to get
    • blockinfo: Whether the current user is blocked, by whom, and why
    • hasmsg: Whether the current user has new messages on their user talk page. To clear the flag, use ClearHasMsg or, for MediaWiki versions below 1.24, load the page via index.php.
    • groups: Which groups the current user belongs to
    • implicitgroups: Lists all the groups the current user is automatically a member of 1.18+
    • rights: Which rights the current user has
    • changeablegroups: Which groups the current user can add/remove 1.16+
    • options: Which preferences the current user has
    • preferencestoken: Get a token to change current user's preferences 1.14+
    • editcount: The number of edits the current user has made 1.12+
    • ratelimits: Rate limits applying to the current user 1.12+
    • realname: User's real name 1.18+
    • email: Email address and authentication timestamp 1.15+
    • acceptlang: Echoes the Accept-Language header sent by the client in a structured format 1.17+
    • registrationdate: Adds the user's registration date 1.18+
    • unreadcount: Adds the count of unread pages on the user's watchlist (maximum 999; returns "1000+" if more) 1.24+

Example[edit]

General user info

Possible errors[edit]

None.