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

FortiNAC API count parameter not working

While making the API calls to FortiNAC, we are trying to use pagination, but it is not working as expected.

 

We are using this API reference: https://fortinetweb.s3.amazonaws.com/docs.fortinet.com/v2/attachments/b0dca655-7aec-11ec-a0d0-fa163e...

 

This is the command we're trying:

curl --location 'https://10.50.4.178:8443/api/v2/device?start=2&count=5' --header 'Authorization: Bearer MHPnxA4L3vza0IF0nQFjn4rQ08yanX' --header 'Cookie: JSESSIONID=A0BFF010C063F13EB28610B6B10C9EDA; JSESSIONID_PORTAL=FB3ECB4D3BAC500A841E1B79BA473FC7'

Could you please help us know if we should use this parameter (count) in some other way? count parameter doesn't seem to be working. 

6 REPLIES 6
ebilcari
Staff
Staff

If you want to just count devices use this URL: https://fnac.eb.eu:8443/api/v2/device/count

count.PNG

More information related to API can be found here: https://fndn.fortinet.net/

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

Hi @ebilcari,

Actually, we don't want only count, but data as well.  

 

We are also using this API: 
https://10.50.4.178:8443/api/v2/device?start=2&count=5

 

However, the count parameter doesn't seem to be working in this case. As a result, instead of getting a paginated response, we are getting all the devices in a single API call. 

 

Now, if the environment size is large, then this will cause an issue because the payload size will be too large to fetch in a single API call. 

 

So, can you please guide us how can we paginate the data? Are we supposed to use count parameter in some other way? 

 

We have referred this guide: https://fortinetweb.s3.amazonaws.com/docs.fortinet.com/v2/attachments/b0dca655-7aec-11ec-a0d0-fa163e...

ebilcari

I tested the same and it looks like the start and count get ignored, at least as I see it from postman.

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

Hi @ebilcari, so is this something which is a known issue? Or does it have any workaround?

 

So you know what can we do get the resolution to this?

 

In our case, start parameter is working, but count is not working. 

ebilcari

I searched internally and yes there is an open Engineering ticket investigating this issue. It looks like currently the "count" get's ignored on the REST API call. You can search in the release notes when this fix will be included in the next builds with reference number: 951436

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

Hi @georgebenzy,

  1. We double-checked the documentation. It doesn't mention any such requirement. 
  2. The server response is also not returning any error message or details regarding count parameter. It seems to be ignoring the param. 
  3. We are using this doc which is for v2 API, and we are also using v2. 

I am not sure if this is a doc issue or a bug in the API. 

Top Kudoed Authors