Generate an API Token
Each REST API request requires an API token to be authenticated. An API token is generated by creating a new REST API admin.
The steps below must be performed from the FortiNAC GUI as an Administrator with a profile that allows Admin User creation and are customized for this tutorial. |
Step 1: Determine your Source Address
The source address is needed to ensure the API token can only be used from trusted hosts. To obtain this address, locate the IP Address of the machine you are going to be issuing the REST API request from. Keep track of this for later use when we create the API user.
Step 2: Create an Administrator profile
The REST API admin should have the minimum permissions required to complete the request. |
In this tutorial, we will create a profile that only has Read access to the Host API.
- On the FortiNAC GUI, select User > Admin Profiles and click the Add button.
- Populate the fields as shown in the following images:
- Click OK.
Step 3: Create the REST API Admin
Use the steps below to create the FortiNAC API admin.
- On the FortiNAC GUI, select System > Admin Users and click the Add button.
- Populate the User ID you would like to use.
- Click OK.
- Select the Admin Profile that you created in the previous steps and fill in the required additional information.
- Select the checkbox that indicates you want this User to have API access and generate a token.
- Copy down this token as it will need to be included in your REST API calls and will be hidden after this configuration is completed.
- Make sure you enter the Allowed Subnets ( in this case the IP Address you used with a mask of 32 ).
- Click OK to finish creating this User.
Next: Your First API Request