Skip to main content
Staff & Editor
September 30, 2022

Technical Tip: Retrieving data from FortiNAC using REST API

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. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT