7.1. OpenNAC API-Doc
The OpenNAC Enterprise Application Programming Interface (API), shows a formal specification about how external software modules can communicate with OpenNAC Enterprise
You can access the OpenNAC Enterprise API documentation through a web browser using the HTTPS protocol to your OpenNAC web console by adding /api-doc in the end.
https://<open_core_ip>/api-doc
The Administration Portal login page will be displayed.

It is necessary to log in using our credentials. However, during the initial login, we may not have immediate access to the API documentation and encounter the following message:

If you are using the Default Portal, go to the Configuration > Configuration Vars > Generic section.
https://<open_core_ip>/admin

The Allow access to API Documentation (api-doc) flag must be enabled to allow access to the API-Doc. Save the changes by clicking on the Save button and try to access the /api-doc again.
If you are using the NextGen Portal, go to the Configure > Configuration > Configuration Vars > General -Frontend section.
https://<open_core_ip>/admin

The Allow access to API Documentation (api-doc) flag must be enabled to allow access to the API-Doc. Save the changes by clicking on the Save button and try to access the /api-doc again.
Now, you should have access to the API-Doc.

First, we need to authorize our user in the API, and get the API Key. The first API call will allow us to authorize our user.

We can see that for every call we have the parameters needed, with an example of them, and the responses expected. And most important, we have a button called Try it out that allows us to execute the selected call.
By clicking on Try it out we will see the following:

In the blank box, you can enter the parameters needed for the call.
In this case we want to execute this call to get the API Key for the user admin with password opennac. We click on execute to get the API response:

A call to the API has been completed. We can see the curl executed for that call and the response of the API. In this case, we have the API has returned the API Key for admin user.
Once we have the API Key, we need to go to the Authorize button on the top right.

We need to add the token of the previous API call.

As we can see, we would get access to the API.

Now, we can execute all the API calls that we can find on the API Doc.