Question

Get list of group members from the API?

  • 5 May 2023
  • 1 reply
  • 46 views

Badge

Sorry if this is a really basic question, but I can’t see how to do this.

I can pull up information for a single group and this has the server_count property, but not a list of members.

And when I do it the other way round and pull a list of devices I can see the policies assigned to that device but not group memberships. 

I must be missing something somewhere. Any help gratefully received.


1 reply

Userlevel 3

Hi @andyM!

You are correct.  The getServerGroup and getServerGroups APIs do not include a list of devices that are within the group, only the total device count as an integer.

 

If you are trying to retrieve the members of a group, you’ll want to use the getDevices API instead.  This will output all devices within your org, and include the "server_group_id" property which will show which group the device is a member of.
 

 

 

Let me know if you have any other questions.

 

Have a great day!

Reply