Skip to main content
dhvanilshah
Explorer
Sep 15, 2023 1:11 PM UTC
Solved

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-fa163e15d75b/FortiNAC_REST_Schema_9.2_%281%29.pdf

 

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?

dhvanilshah
Explorer
Sep 20, 2023 9:02 AM UTC

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.

5 replies

Anthony_E
Staff
Staff
Sep 18, 2023 2:45 AM UTC

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,

Best Regards
dhvanilshah
dhvanilshahAuthorAnswer
Explorer
Sep 20, 2023 9:02 AM UTC

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.

ebilcari
Staff
Staff
Sep 21, 2023 12:05 PM UTC

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". 

Emirjon
dhvanilshah
Explorer
Sep 21, 2023 12:37 PM UTC

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!

Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024