How to create Sub Domains dynamically by PHP using Virtualmin GPL

Hi I can create subdomains from Virtualmin admin panel, but I want to do it from the frontend by PHP coding. I am using Virtualmin GPL.
Form this tutorial: http://vikku.info/programming/php/create-subdomain-dynamically-in-php-code-to-create-subdomains-in-server-using-php.htm
I can create subdomains in the cPanel. But need to know about the Virtualmin, how to call this method in Virtualmin, any examples there??

Howdy,

You may want to try Virtualmin’s “Remote API” Details on using it are here:

https://www.virtualmin.com/documentation/developer/http

Thank u very much…its works…