Hi,
I’m using version 2025.18.0 of the microservice SDK.
I’m trying to get the parent devices of a specific device:
var child = inventoryApi.get(deviceId, InventoryParam.withParents());
With this call parents are not returned.
To check that it’s not a bug in the SDK, I also performed the call using Spring RestClient and RestTemplate.
Parents are never returned in the response.
Of course invoking the API from postman/insomnia works, using the microservice credentials (so it’s not a role issue).
What could be wrong?
Many thanks in advance.
My bad, I was making the call after cleaning the device hierarchy, which at least shows that things were done right 
Interestingly enough, I tested various ways to interact with hierarchy:
inventoryApi.getManagedObjectsByFilter(InventoryFilter.searchInventory().byChildDeviceId(deviceId)).get().allPages()
returns the list of managed object that are direct parents of the device, so this is rather the one I was looking for
inventoryApi.get(deviceId, InventoryParam.withParents()).getDeviceParents().references()
this one, that I was using before, actually return the whole parent hierarchy up to the root as references, which is not what I was actually looking for. Looking at the API doc, I think this should be better explained.