API:Userinfo
Jump to navigation
Jump to search
| 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 |
|---|
{
"batchcomplete": "",
"query": {
"userinfo": {
"id": 31345756,
"name": "Kenny2wiki",
"rights": [
"createaccount",
"read",
"edit",
"createtalk",
"writeapi",
"viewmywatchlist",
"editmywatchlist",
"viewmyprivateinfo",
"editmyprivateinfo",
"editmyoptions",
"abusefilter-view",
"abusefilter-log",
"abusefilter-log-detail",
"centralauth-merge",
"vipsscaler-test",
"ep-bereviewer",
"collectionsaveasuserpage",
"reupload-own",
"move-rootuserpages",
"move-categorypages",
"createpage",
"minoredit",
"editmyusercss",
"editmyuserjson",
"editmyuserjs",
"purge",
"sendemail",
"applychangetags",
"spamblacklistlog",
"ep-enroll",
"mwoauthmanagemygrants",
"reupload",
"upload",
"move",
"collectionsaveascommunitypage",
"autoconfirmed",
"editsemiprotected",
"movestable",
"autoreview",
"transcode-reset",
"skipcaptcha"
]
}
}
}
|
Possible errors[edit]
None.