Forum Discussion

Lewis_Beard's avatar
13 days ago
Solved

API endpoint for User Groups?

I am super terrible at searching or picking the right keywords, but I am completely stumped on whether I can use the API to get a list of User Groups. I searched the Swagger page ( https://www.logicmonitor.com/support/rest-api-v3-swagger-documentation ) for user group, group, and looked through everything, and I cannot find a GET command to pull back a list of User Groups. I'm talking about the section under settings where you can make Users or User Groups, like if you wanted to organize "Department 1" and "Department 2" or "Ungrouped" under your users list.

Can anyone tell me the endpoint for getting a list of User Groups?

I swear I've combed the API swagger doc for every occurrence of group on the page, and found nothing. Maybe it doesnt exist in V3? Or maybe I'm terrible at searching. :) I would just grab all the users and brute force a list, except I am specifically wanting to interact with any empty User Groups as well, so I have no idea how I would find them with the API

Thanks, and sorry for such a basic question.

 

  • Lewis_Beard's avatar
    Lewis_Beard
    12 days ago

    Well I found the solution. I dont like it but I found it. As I mentioned, the endpoint that worked in API V1, "/setting/admin/groups", does not exist in the swagger DOC in API V3. So I thought the functionality was removed since there was no "/setting/admins/groups" (admins with an "s") in the documentation for V3, and the old one wasnt present.

    BUT annoyingly, the OLD endpoint from API V1 still works, and I can actually get a response from "/setting/admin/groups" but I guess that means technically its unsupported.

    Thanks!

4 Replies

  • Only came to community looking for something else but lucky ;)

    /santaba/rest/setting/roles or if you want to filter on a explicit role /santaba/rest/setting/roles?filter=name:"Group Name"

    • Lewis_Beard's avatar
      Lewis_Beard
      Icon for Expert rankExpert

      Well I found the solution. I dont like it but I found it. As I mentioned, the endpoint that worked in API V1, "/setting/admin/groups", does not exist in the swagger DOC in API V3. So I thought the functionality was removed since there was no "/setting/admins/groups" (admins with an "s") in the documentation for V3, and the old one wasnt present.

      BUT annoyingly, the OLD endpoint from API V1 still works, and I can actually get a response from "/setting/admin/groups" but I guess that means technically its unsupported.

      Thanks!

    • Lewis_Beard's avatar
      Lewis_Beard
      Icon for Expert rankExpert

      It looks like the data for the User Groups is in the results of /setting/admins for the users in the user model, under adminGroupIds. But the problem is, I need to be able to get a list of those independent of the users because I need to interact with the empty ones. And there is nothing I see like /setting/admins/groups/ or anything like that to get a list.

      I do see some API V1 code where you could get to this exact item using /setting/admin/groups, but in API V3, it is gone, and there is no /setting/admins/groups either. Maybe LM took that out as an option. I'm hoping they just renamed it in some weird way and that I can still get to it.

    • Lewis_Beard's avatar
      Lewis_Beard
      Icon for Expert rankExpert

      I'm not looking to get the Roles or the Role Groups. I'm looking to get the User Groups.

      Regardless of what roles a user belongs to, in the UI there are a list of User Groups that the users are put into for organizational purposes that are NOT the roles.

      For example, under users I might have User Groups such as "Ungrouped", "Internal", "External", and "Suspended". This is the list I need, they are not Roles. Some of the people in "Internal" might be in various Roles such as "Accounting" or "Report Managers" or both. But that's not what I need.

      In other words, I'm not talking about this:

      I'm talking about these items:

       

      So far, I havent been able to pull back the list of those User Groups. I'll keep looking. While trying to explain what I'm looking for I may have found something. Hmm.