Zabbix Documentation 1.8

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

api:usergroup:get

Table of Contents

get()

Available since version: 1.8
This function allows you to retrieve user group 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.

Parameters

ParameterTypeDescriptionDetails
nodeidsarrayNode IDs
usrgrpidsarrayUserGroup IDs
useridsarrayUser IDs
statusboolean
with_gui_accessboolean
with_api_accessboolean
editableintegeronly with read-write permission. Ignored for SuperAdmins
filterarrayOptional filter by user group fields
searcharrayReturn user groups by any given user group object field pattern
startSearchintegerSearch user groups field pattern only in start of the field
excludeSearchintegerExclude from result, user groups by given field pattern
searchWildcardsEnabledintegerSearch pattern in whole field using wildcards 1 - enable, 0 - disable
select_usersstring Select contained users Values: refer, extend
outputstringOutput options Values: shorten, refer, extend
countOutputintegerCount user groups, return the number of user groups found
preservekeysintegerReturn hash instead of array Keys of hash are object IDs
sortfieldstringSort by user group field Values: usrgrpid, name
sortorderstringSort order Values: ASC, DESC
limitintMax number of user group objects to return

Returns

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

Example

Get details for user groups with names “Debug group”,“Zabbix administrators”, and select users ID in those groups :

{
"jsonrpc":"2.0",
"method":"usergroup.get",
"params":{
	"filter":{"name":["Debug group","Zabbix administrators"]},
	"select_users":"refer",
	"output":"extend"
},
"auth":"6f38cddc44cfbb6c1bd186f9a220b5a0",
"id":2
}

Retrieved details for user groups with names “Debug group”,“Zabbix administrators” :

{
"jsonrpc":"2.0",
"result":[
{
	"users":[
		{"userid":"100100000000005"}
	],
	"usrgrpid":"100100000000007",
	"name":"Zabbix administrators",
	"gui_access":"0",
	"users_status":"0",
	"api_access":"0",
	"debug_mode":"0"
},
{
	"users":[
		{"userid":"100100000000005"},
		{"userid":"100100000000001"},
		{"userid":"100100000000003"},
		{"userid":"100100000000004"},
		{"userid":"100100000000018"}
	],
	"usrgrpid":"100100000000022",
	"name":"Debug group",
	"gui_access":"0",
	"users_status":"0",
	"api_access":"0",
	"debug_mode":"1"
}],
"id":2
}