How to filter/search in API

Solved

Hi all,

i have a problem to filter/search via the API using 

/devices/search (URL encoded ofc) or /devices

In both i always get that the filter is not set correctly but i don't get what to change.
In general i want to do following via API:

The relevant URL is then like: 
https://SOTISERVER.EXT/MobiControl/WebConsole/home/dashboard/devices?search=IsAgentOnline%20Equal%20%22FALSE%22%20AND%20LastAgentDisconnectTime%20NotWithIn%20%2230%20DAYS%22%20&groups=PATH&subGroups=true

I tried for example:

  • IsAgentOnline:false
    • As it can be found later in the data and in the example at least for the /devices (Property:Value)
  • "IsAgentOnline":false
  • IsAgentOnline=false
  • ...

But with no success, I always get "Parameter filter has invalid value IsAgentOnline." or similar.

I also did it with no issue without a filter set and then in the devices data provided for example "IsAgentOnline": false can be found but seem not to be able to be used that way.

We use version 2024.1.1

Can anyone tell me how to enter the filter correctly?

6 months ago
SOTI MobiControl
ANSWERS
RS
Rafael Schäfer
6 months ago

I noticed now that for /devices/search following works:

IsAgentOnline%3Dfalse (%3D = "=")

I wonder why, as it says:

"The following operators for searching on date and time are deprecated in 14.3.0 and they will be retired in 15.0.0.

  1. = equal
  2. <> not equal
  3. > greater than
  4. < less than"

But those work, anything else like writing equal or so doesn't.

RS
Rafael Schäfer
6 months ago

I was able to build it now by using chrome developer tools when working with the console.

But would like to ask Soti to provide a REAL documentation how the filters have to be set and also how to connect multiple ones.

Solution

Hello Rafael Schäfer, 

Thank you for requesting an answer from SOTI Support Staff.

We're glad you were able to find a resolution for this issue.  I used your link in a  2025.0.2.1059 environment and although it gave an odd response as well, the results were filtered by the requested parameters. 

I agree that to receive the response " The following Operators for searching on date and time are deprecated in 14.4 and they will be retiring in 15.0.0" is an odd response if not applicable.

Nonetheless, I have requested having another Moderator look into this more in detail for us and update the thread.  With regards to the documentation, I found this help file link below regarding search parameters.

https://soti.net/mc/help/v15.6/en/console/start/search_bar_advanced.html?hl=search&plugin_version=chrome_4.0.6

Hopefully, the assigned Moderator has more information on this topic to assist you better with this.

Warm regards,