[help] API system_usermanager.php

Started by surat, January 28, 2020, 11:51:03 AM

Previous topic - Next topic
What is the API for create user on OPNsenseURL/system_usermanager.php?act=new ?? I didn't see it in the documentation https://docs.opnsense.org/development/api.html

Many thanks!

There is no API for that. In general, look at the URL and if it contains /ui after the host, it is likely having an API behind. Many legacy pages are not migrated yet but some are and mostly all plugins as well.

is there a way to create users without OPNsense-WebGUI? I need to create users via curl or python for integrate with my internal Human Resource application. Is there any reference to do that?

You can

... Port the page to MVC
... Use Selenium to automate a browser
... You can work in a script with the pages (example: https://github.com/fabianfrz/scripts/blob/master/OPNsense/backup_over_http.rb)
... Write a custom script which dies the same as the UI on OPNsense and updates your data periodically.