integer/array user.get(object parameters)
The method allows to retrieve users according to the given parameters.
(object)
Parameters defining the desired output.
The method supports the following parameters.
Parameter | Type | Description |
---|---|---|
mediaids | string/array | Return only users that use the given media. |
mediatypeids | string/array | Return only users that use the given media types. |
userids | string/array | Return only users with the given IDs. |
usrgrpids | string/array | Return only users that belong to the given user groups. |
getAccess | flag | Adds additional information about user permissions. Adds the following properties for each user: gui_access - (integer) user's frontend authentication method. Refer to the gui_access property of the user group object for a list of possible values.debug_mode - (integer) indicates whether debug is enabled for the user. Possible values: 0 - debug disabled, 1 - debug enabled.users_status - (integer) indicates whether the user is disabled. Possible values: 0 - user enabled, 1 - user disabled. |
selectMedias | query | Return media used by the user in the medias property. |
selectMediatypes | query | Return media types used by the user in the mediatypes property. |
selectUsrgrps | query | Return user groups that the user belongs to in the usrgrps property. |
sortfield | string/array | Sort the result by the given properties. Possible values are: userid and alias . |
countOutput | flag | These parameters being common for all get methods are described in detail in the reference commentary. |
editable | boolean | |
excludeSearch | flag | |
filter | object | |
limit | integer | |
nodeids | string/array | |
output | query | |
preservekeys | flag | |
search | object | |
searchByAny | boolean | |
searchWildcardsEnabled | boolean | |
sortorder | string/array | |
startSearch | flag |
(integer/array)
Returns either:
countOutput
parameter has been used.Retrieve all of the configured users.
Request:
{
"jsonrpc": "2.0",
"method": "user.get",
"params": {
"output": "extend"
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": [
{
"userid": "1",
"alias": "Admin",
"name": "Zabbix",
"surname": "Administrator",
"url": "",
"autologin": "1",
"autologout": "0",
"lang": "ru_RU",
"refresh": "0",
"type": "3",
"theme": "default",
"attempt_failed": "0",
"attempt_ip": "",
"attempt_clock": "0",
"rows_per_page": "50"
},
{
"userid": "2",
"alias": "guest",
"name": "Default2",
"surname": "User",
"url": "",
"autologin": "0",
"autologout": "900",
"lang": "en_GB",
"refresh": "30",
"type": "1",
"theme": "default",
"attempt_failed": "0",
"attempt_ip": "",
"attempt_clock": "0",
"rows_per_page": "50"
}
],
"id": 1
}
CUser::get() in frontends/php/api/classes/CUser.php.