3 years ago
API Filtering Info
Hi Everyone,
I've found myself doing the same searches on API filtering multiple times, so wanted to gather and share some of what I've found & learned in hopes of helping others out (and let...
*** DISREGARD ***
Being a fool, I was using CustomProperties instead of customProperties 🤣
----- Original Message ----
Sorry to dig up an old thread. I’m looking at trying to find a Device Group ID based on trying to match (~) a value in a few areas and this thread was one of the only ones that seems to discuss API filtering.
I’m trying to work out the filter syntax to try and match:
device group “name”
-or-
custom property “location”
-or-
custom property “company.alias”
Unfortunately i’m not getting the results I’m looking for. If I use the _all~{search} I do return what I”m looking for, but that may be too broad for me to use (_all).
I tried something like this:
api.get_device_group_list(filter=f"name~\"{search}\"||CustomProperties.value~\"{search}\"")
But it does not return anything, but when I do the same {search} using _all it does return the device group ID i’m looking for.
In this case, the Device Group will have a custom property for “company.alias” that I’m trying to match on. If I put the actual “name” into the search, I get the response I’m expecting.
Any ideas where I might be going wrong?