OpenVPN Rest Api

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
thomas7
OpenVpn Newbie
Posts: 2
Joined: Tue May 07, 2019 2:32 pm

OpenVPN Rest Api

Post by thomas7 » Tue May 07, 2019 4:36 pm

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.

User avatar
novaflash
OpenVPN Inc.
Posts: 1073
Joined: Fri Apr 13, 2012 8:43 pm

Re: OpenVPN Rest Api

Post by novaflash » 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
I'm still alive, just posting under the openvpn_inc alias now as part of a larger group.

thomas7
OpenVpn Newbie
Posts: 2
Joined: Tue May 07, 2019 2:32 pm

Re: OpenVPN Rest Api

Post by thomas7 » Wed May 08, 2019 9:04 am

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?

User avatar
novaflash
OpenVPN Inc.
Posts: 1073
Joined: Fri Apr 13, 2012 8:43 pm

Re: OpenVPN Rest Api

Post by novaflash » Wed May 08, 2019 5:02 pm

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.
I'm still alive, just posting under the openvpn_inc alias now as part of a larger group.

desuvarun
OpenVpn Newbie
Posts: 1
Joined: Wed Jan 31, 2024 9:50 pm

Re: OpenVPN Rest Api

Post by desuvarun » Wed Jan 31, 2024 9:51 pm

Cant we get the users connected or connection history using APIs . If there is another way to fetch those please post it here

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1333
Joined: Tue Feb 16, 2021 10:41 am

Re: OpenVPN Rest Api

Post by openvpn_inc » Mon Feb 05, 2024 5:14 pm

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
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

Post Reply