KACE Product Support Question

Query Labels from KACE API

03/05/2018 921 views
Is this possible?

I'd like to use the API to return a set of machines for a given label. I don't see anything in the documentation that shows how one would fetch this data, if it is possible.

We'd like to use this for integration with other automation workflows in our environment.

I know how to do this using a MySQL client, but I'd prefer to use the REST API so I don't have a Sql dependency.

Can anyone point me in the right direction? 
0 Comments   [ + ] Show comments


Community Chosen Answer

You want to use a filter on label.name:
/api/inventory/machines?filtering=label.name eq Library Services

In the API reference guide there is a list of Definitions at the end of the Inventory API Reference section. Those definitions define what you can use to filter the results. For instance, the machine schema contains many of the columns from the MACHINE table and this API query will return machines where the OS_Name contains macOS:
/api/inventory/machines?filtering=machine.os_name co macOS

Answered 03/06/2018 by: chucksteel
Red Belt

  • Awesome. Exactly what I need. Thanks for the answer.

All Answers

If you use Powershell, there's a community written module that will query the API and return a result.

This will retrieve machines in a smart label called "D - SmartLabel - Test"

Get-SmaMachineInventory -Server https://kace.example.com -Org Default -Credential (Get-Credential) -QueryParameters "?shaping=machine all&paging=limit ALL&filtering=label.name eq D - SmartLabel - Test"
Answered 09/17/2018 by: isudothings
Senior Purple Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ