API:Userinfo
| Userinfo | ||
|---|---|---|
| Get information about the current user. This module cannot be used as a Generator. |
||
| Prefix | ui | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
For getting information about other users, see API:Users.
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 getblockinfo: Whether the current user is blocked, by whom, and whyhasmsg: 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 toimplicitgroups: Lists all the groups the current user is automatically a member of 1.18+rights: Which rights the current user haschangeablegroups: Which groups the current user can add/remove 1.16+options: Which preferences the current user haspreferencestoken: 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
| Result |
|---|
<?xml version="1.0" encoding="utf-8"?>
<api>
<query>
<userinfo name="Jborme" messages="">
<rights>
<r>createaccount</r>
<r>read</r>
<r>edit</r>
<r>createpage</r>
<r>createtalk</r>
<r>reupload-own</r>
<r>read</r>
<r>edit</r>
<r>createpage</r>
<r>createtalk</r>
<r>upload</r>
<r>minoredit</r>
<r>purge</r>
<r>reupload</r>
<r>move</r>
<r>autoconfirmed</r>
<r>skipcaptcha</r>
<r>emailconfirmed</r>
</rights>
</userinfo>
</query>
</api>
|
Possible errors[edit]
None.