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 first "items"(response['data']['tems'][0]) having an ID value is the devicegroupid ?
Is there any other way I can get the hostroupID by just the name or customerprefix of the deployment.
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