- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to use filter query param while using REST APIs
I am using FortiNAC Rest APIs to fetch list of hosts using endpoint "/api/v2/host"
I am following this documentation https://fortinetweb.s3.amazonaws.com/docs.fortinet.com/v2/attachments/b0dca655-7aec-11ec-a0d0-fa163e...
But i am not sure about how to use filter query param or what will be its format. My intention is to bring all the NOT ROGUE devices.
Can someone help me with the same?
Solved! Go to Solution.
- Labels:
-
FortiNAC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the solution by trial and error. So it can be achieved using below query parameters
https://10.50.4.178:8443/api/v2/host?type!=9
But can I get some documentation pointing to the type = 9 being as an enum to Rogue device. So that i can be sure of this.
I've searched in multiple sources but nothing helpful turned out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Thank you for using the Community Forum. I will seek to get you an answer or help. We will reply to this thread with an update as soon as possible.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the solution by trial and error. So it can be achieved using below query parameters
https://10.50.4.178:8443/api/v2/host?type!=9
But can I get some documentation pointing to the type = 9 being as an enum to Rogue device. So that i can be sure of this.
I've searched in multiple sources but nothing helpful turned out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The host type can be checked from CLI:
> dumphostrecords -all
I did a check and rouge devices are indeed shown with "type = 9" and registered device with "type = 8".
If you have found a solution, please like and accept it to make it easily accessible for others.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ebilcari, thanks for verifying.
We are unable to find the mapping anywhere in the API or the docs.
Will this mapping always be static? That is, will type 9 always mean Rogue? Or can it change? If it can change, is there any API which returns all the current types? If it's static, is there any doc reference which maps the int received in type to actual values?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I know this type is directly derived from the DB so I wouldn't expect for this to change.
If you have found a solution, please like and accept it to make it easily accessible for others.
