Page 1 of 1

OpenVPN Rest Api

Posted: Tue May 07, 2019 4:36 pm
by thomas7
We have set up an access server and I have been trying to get some useful data with rest queries.
I am using this: https://openvpn.net/images/pdf/REST_API.pdf as a documentation where the request is of the form:

Code: Select all

curl -u USERNAME:PASSWORD https://ACCESS_SERVER:CWS_PORT/rest/METHOD
Everything works fine but I would like to learn if there is a fully documented list of the METHODs available. I have only found documentation for GetUserlogin, GetAutologin and GetGeneric, and I would like to know if there are any other methods available and their form.

Re: OpenVPN Rest Api

Posted: Tue May 07, 2019 4:57 pm
by novaflash
That's pretty much all there is for REST. All other remote procedure calls must be done through XML-RPC - with the information on this page anything that you can do on the command line can also be done with remote procedure calls;
https://openvpn.net/vpn-server-resource ... -interface

Re: OpenVPN Rest Api

Posted: Wed May 08, 2019 9:04 am
by thomas7
novaflash wrote:
Tue May 07, 2019 4:57 pm
That's pretty much all there is for REST. All other remote procedure calls must be done through XML-RPC - with the information on this page anything that you can do on the command line can also be done with remote procedure calls;
https://openvpn.net/vpn-server-resource ... -interface
Thank you very much for your answer!
So it is not possible, for instance to create new users or connect to the VPN via some rest queries, right?
Is this possible only via command line?

Re: OpenVPN Rest Api

Posted: Wed May 08, 2019 5:02 pm
by novaflash
Via REST, no, you cannot create users. But you can obtain profiles for existing users using REST, using rest/getAutologin and rest/GetUserlogin.

To create users, you can use either the web interface, the command line interface, or the XMl-RPC interface. But not REST.

Re: OpenVPN Rest Api

Posted: Wed Jan 31, 2024 9:51 pm
by desuvarun
Cant we get the users connected or connection history using APIs . If there is another way to fetch those please post it here

Re: OpenVPN Rest Api

Posted: Mon Feb 05, 2024 5:14 pm
by openvpn_inc
Hello desuvarun,

With the XML-RPC interface set to full API (level 2) you can indeed query the status of the server and do pretty much anything you like. The only documentation that exists for this is on our website that shows how you can use a debug flag to use the command line tools to do the XML-RPC call and what the response looks like. The entire XML-RPC conversation will be printed on screen so you can see exactly what's going on and how to reproduce it in your own XML-RPC client.

https://openvpn.net/vpn-server-resource ... -interface

Yes, this will require that you experiment a little. But the upside is, it will allow you to fully remotely control Access Server via XML-RPC.

Kind regards,
Johan