FortiNAC
NOTE: FortiNAC is now named FortiNAC-F. For post-9.4 articles, see FortiNAC-F. FortiNAC is a zero-trust network access solution that provides users with enhanced visibility into the Internet of Things (IoT) devices on their enterprise networks.
Hawada1
Staff & Editor
Staff & Editor
Article Id 227625
Description This article describes how to use the cURL REST API script using the 'POST' method to create a new Network Container on FortiNAC.
Scope FortiNAC.
Solution

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


The below cURL script will automatically create a network container using the REST API POST method sent via Postman:


curl --location --request POST 'https:// <ha-ip/standalone-ip>:8443/api/v2/device/container' \

--header 'Content-Type: application/json' \

--header 'Authorization: Bearer <API-Token-KEY>' \

--data-raw '{"name": "<Container-name>","id": <id-is-optional>}'

 

Note: The 'id' is optional.

Hawada1_0-1666537291699.png

 

Hawada1_1-1666537303429.pngHawada1_2-1666537313245.png

 

Note:

It is possible to add as many 'name' as needed.

Once the postman is done on Postman, select 'Send'.

A successful response from FortiNAC as an output on Postman should appear:

 

Hawada1_3-1666537342127.png

 

Then go to Network -> Inventory on FortiNAC, the container should be created.

 

Hawada1_4-1666537364277.png

 

Related documents:
https://community.fortinet.com/t5/FortiNAC/Technical-Tip-Retrieving-data-from-FortiNAC-using-REST-AP...
https://fortinetweb.s3.amazonaws.com/docs.fortinet.com/v2/attachments/ea5c5de5-ebd6-11ea-96b9-005056...