Documentation

api.users.usergroups

Fetch the user groups for a user by their user_id.

Arguments:

def api.users.usergroups(
  user_id: str = None, # User ID
):

Returns list of dict in the form

[
  { 
    'usergroup_id': <int>,
    'name': <str>,
    'color': <str>,
    'meta_data': <None | dict>,
    'reservation_visibility': <bool>,
    'reservation_editing': <bool>,
  },
...
]

Example:

groups = api.users.usergroups(user_id="foo") # groups = [ <dict> ]