The OPNsense API calls are structured in the form:
There are two HTTP verbs used in the OPNsense API:
GETRetrieves data from OPNsense
POSTCreates new data, updates existing data or executes an action
The body of the HTTP POST request and response is an ‘application/json’ object.
The $key and $secret parameters are used to pass the API credentials using curl. You need to set these parameters with your own API credentials before using them in the examples: