Posted on 08-24-2023 01:26 PM
I'm looking for the correct API method to get a list of computers in a smart group.
The documentation for smart-computer-groups-preview says it does exactly what I want, but I believe that description is incorrect.
It says: Recalculates the smart group for the given id and then returns the ids for the computers in the smart group
That's exactly what I need... unfortunately, it doesn't work. It just returns the count of computers in the Smart Group, it doesn't return the list of computer IDs. Even the example responses in the documentation just show it returning a Count.
What's the right way to get the list of computers in a Smart Group from the API?
Thank you!
Posted on 08-24-2023 06:59 PM
@NullPointer I'd agree that API endpoint description should do what you're asking but actually doesn't (at least as of JSS 10.49.0) so you should report that to Jamf Support
You can however get the information using the https://yourServer.jamfcloud.com/JSSResource/computergroups/id/{id} endpoint of the Classic API.
Posted on 08-25-2023 09:15 AM
Thanks @sday, I'll do that!
Posted on 09-06-2023 09:51 AM
Jamf support said they were unsure if or when it would be resolved and that the V1 of the API should work for now and that the functionality may change over time... so I'll investigate the Classic API as you suggested, @sdagley . Thanks again!
Posted on 10-20-2023 06:37 AM
Well that's damned annoying. I'm trying to get FortiClient to pull a list of computers from a smart group (preferably names, but I guess IDs would do) to check compliance. I created the API role and everything. Now I have to make it a user? Lame.