API
Was this helpful?
Most actions that can be performed via API can be performed via the UI. We recommend managing your networks using the official netmaker-ui project. However, Netmaker can also be run without the UI, and all functions can be achieved via API calls. If your use case requires using Netmaker without the UI or you need to do some troubleshooting/advanced configuration, using the API directly may help.
API calls must be authenticated via a header of the format:
-H "Authorization: Bearer <YOUR_SECRET_KEY>"
There are two methods to obtain YOUR_SECRET_KEY:
By default, this value is “secret key,” but you should change this on your instance and keep it secure. This value can be set via env var at startup or in a config file (config/environments/*.yaml). See the Server Configuration documentation for more details.
Requests take the format of:
curl -H "Authorization: Bearer <YOUR_SECRET_KEY>" \
-H 'Content-Type: application/json' \
localhost:8081/api/path/to/endpointCheck the documentation for all available endpoints.
Was this helpful?
Was this helpful?