Forum Discussion

Vinusha's avatar
7 years ago

Get LM DeviceGroup Properties REST API

I'm accessing the get device group properties api by using name in filters to get the hostgroupID. I need a confirmation on get device group properties api. In the response output, is the fir...
  • Sarah_Terry's avatar
    7 years ago

    Hi Vinusha,

    If you're trying to get device group id using the device group name, you can make a request like this:

    GET /device/groups?filter=name~"NAME"

    And the 'id', first field in the items object (as you've noted) is the group id. You can restrict the fields returned in the response using the 'fields' query parameter as well.

    You can also get device group id by filtering the request by property, like this:

    GET /device/groups?fields=customProperties,name,id&filter=customProperties.name:customer.name,customProperties.value:customerA

    This request will return the customProperties, name and id of groups that have a property customer.name set to customerA.

    Does this help with what you're trying to do?

    Thanks,

    Sarah