Zabbix Documentation 1.8

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


Sidebar

api:user:get

Table of Contents

get()

Available since version: 1.8
This function allows you to retrieve user details based on filtering options. All parameters are optional. If parameter is set in query this option counted as ON, except if parameter is equal to NULL, Only super admins have access to all users. Admin users may see only users sharing the same user groups. Simple users may gain info only about them selfs.

Parameters

ParameterTypeDescriptionDetails
nodeidsarrayNode IDs
usrgrpidsarrayUser Group IDs
useridsarrayUser IDs
mediaidsarrayMedia IDs
mediatypeidsarrayMedia type IDs
editableintegeronly with read-write permission. Ignored for SuperAdmins
filterarrayOptional filter by user fields
searcharrayReturn users by any given object field pattern
startSearchintegerSearch users field pattern only in start of the field
excludeSearchintegerExclude from result, users by given field pattern
searchWildcardsEnabledintegerSearch pattern in whole field using wildcards 1 - enable, 0 - disable
outputstringOutput options Values: shorten, refer, extend
select_usrgrpsstringSelect user groups Values: refer, extend
select_mediatypesstringSelect user media types Values: refer, extend
get_accessstringGet additional info about user access to GUI Values: shorten, refer, extend
countOutputintegerCount users, return the number of users found
preservekeysintegerReturn hash instead of array Keys of hash are object IDs
sortfieldstringSort by user field Values: userid, alias
sortorderstringSort order Values: ASC, DESC
limitintmax number of user objects to return

Returns

ParameterDescription
resultOperation successful. Result will contain array of User objects.
errorIn case of any errors

Example

Get users details by user alias “Admin”:

{
"jsonrpc":"2.0",
"method":"user.get",
"params":{
	"filter":{ "alias":["Admin"] },
	"output":"extend"
},
"auth":"6f38cddc44cfbb6c1bd186f9a220b5a0",
"id":2
}
Retrieved user details:

{
"jsonrpc":"2.0",
"result":[{
	"userid":"100100000000001",
	"alias":"Admin",
	"name":"admin",
	"surname":"admin",
	"url":"",
	"autologin":"1",
	"autologout":"0",
	"lang":"en_gb",
	"refresh":"2000",
	"type":"3",
	"theme":"css_od.css",
	"attempt_failed":"0",
	"attempt_ip":"127.0.0.1",
	"attempt_clock":"1281014721",
	"rows_per_page":"100"
}],
"id":2
}