Skip to main content
Staff & Editor
September 30, 2022

Technical Tip: Retrieving data from FortiNAC using REST API

  • September 30, 2022
  • 0 replies
  • 1650 views
Description This article describes how to use cURL Script to retrieve FortiNAC details using RESTAPI.
Scope FortiNAC
Solution

FortiNAC's REST API is a standardized method for other systems to interact with FortiNAC to perform configuration and monitoring operations.


curl --location --request GET 'https://<ha-ip/standalone-ip>:8443/api/v2/device/count/all' --header 'Content-Type: application/json' --header 'Authorization: Bearer <apikey>'


Curl command retrieves the total number of devices managed by FortiNAC in the 'Inventory':


{
"status": "success", <-----
"errorMessage": null,
"results": [],
"filtered": null,
"total": 4 <----- the equals to 4 devices.
}

 


The following Curl query is just another example of retrieving device identities for hosts available in the 'Hosts' view.


curl --location --request GET 'https://<ha-ip/standalone-ip>:8443/api/v2/host/device-identity' --header 'Content-Type: application/json' --header 'Authorization: Bearer <apikey>'


Related article:
Users can also import the above curl queries to Postman to preview data (pages 7 and 8):
https://fortinetweb.s3.amazonaws.com/docs.fortinet.com/v2/attachments/ea5c5de5-ebd6-11ea-96b9-00505692583a/REST_API_V2_Configuration.pdf

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.