Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
dhvanilshah
New Contributor II

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?

1 Solution
dhvanilshah
New Contributor II

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.

View solution in original post

5 REPLIES 5
Anthony_E
Community Manager
Community Manager

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,

Anthony-Fortinet Community Team.
dhvanilshah
New Contributor II

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

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
If you have found a solution, please like and accept it to make it easily accessible for others.
dhvanilshah

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!

ebilcari

As I know this type is directly derived from the DB so I wouldn't expect for this to change.

- Emirjon
If you have found a solution, please like and accept it to make it easily accessible for others.
Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors