Methods > GlpilistGroups

 This method is only accessible by authenticated users
Version Comments
1.3.2 Add parameter Name in listGroup (% allowed)
1.3.0 add filter, parent, under options, remove id2name option
1.2.0 add mine and id2name options
0.2.0 Method added

List groups of the current entities

input a hastable

  • count , start, limit (optional)
  • help option to get usage information
  • mine if set, only retrieve groups of connected user
  • parent if set, only retrieve groups under selected parent (group's ID)
  • name : a optional string (MySQL joker % allowed)
  • under if set, only retrieve child groups of selected one (group's ID)
  • withparent if set, also search for recursive group in parent entities
  • filter optional filter, must be in ('is_requester', 'is_assign', 'is_notify', 'is_itemgroup', 'is_usergroup')

return a array of hashtable

  • all fields of glpi_groups
  • member if current user if member of this group

Call example GLPI 0.83

$ php testxmlrpc.php --session=3u1olttlifhqs6g9f64bmc34c0 --method=glpi.listGroups --filter=is_requester --limit=1
+ Calling 'glpi.listGroups' on http://localhost//glpi083/plugins/webservices/xmlrpc.php?session=3u1olttlifhqs6g9f64bmc34c0
+ Response: Array
(
    [0] => Array
        (
            [id] => 311
            [entities_id] => 300
            [is_recursive] => 0
            [name] => One group
            [comment] => 
            [ldap_field] => 
            [ldap_value] => 
            [ldap_group_dn] => 
            [date_mod] => 2011-05-24 13:27:57
            [is_requester] => 1
            [is_assign] => 0
            [is_notify] => 1
            [is_itemgroup] => 1
            [is_usergroup] => 1
            [groups_id] => 342
            [completename] => Top group > One group
            [level] => 2
            [ancestors_cache] => 
            [sons_cache] => 
            [member] => 1
        )
)

Call example GLPI 0.80

$ php testxmlrpc.php --session=3u1olttlifhqs6g9f64bmc34c0 --method=glpi.listGroups --limit=2
+ Calling 'glpi.listGroups' on http://localhost//glpi080/plugins/webservices/xmlrpc.php?session=3u1olttlifhqs6g9f64bmc34c0
+ Response: Array
(
    [0] => Array
        (
            [id] => 311
            [entities_id] => 300
            [is_recursive] => 0
            [name] => One group
            [comment] => 
            [users_id] => 0
            [ldap_field] => 
            [ldap_value] => 
            [ldap_group_dn] => 
            [date_mod] => 2011-05-24 13:27:57
            [member] => 0
        )
    [1] => Array
        (
            [id] => 312
            [entities_id] => 300
            [is_recursive] => 0
            [name] => Another group
            [comment] => 
            [users_id] => 0
            [ldap_field] => 
            [ldap_value] => 
            [ldap_group_dn] => 
            [date_mod] => 2011-05-24 13:27:57
            [member] => 1
        )
)