0

I'm currently working with XMLAPI in PHP with cPanel to automatically create subdomains for my customers. I've managed to create the script that allows for subdomain creation but I'm having a hard time wrapping my head around using XMLAPI to issue certificates using the LetsEncrypt certificate issuer inside cPanel. Here is the script I use to create subdomains:

$subdomain = $usrdomain;
$cpanelusr = 'myusername';
$cpanelpass = decryptIt(decryptKey("Jzc5WZO5LfOYonIVSNfgQKmQM0qCiUl7Z3ALKqLI41kpwQQdcGn9kQhjH1k04LImjAgRK8B4Q54DPTyfKLtYXA=="));
$xmlapi = new xmlapi('server ip');
$xmlapi->set_port( 2083 );
$xmlapi->password_auth($cpanelusr,$cpanelpass);
$xmlapi->set_debug(0);
$result = $xmlapi->api1_query($cpanelusr, 'SubDomain', 'addsubdomain', array($subdomain,'mydomain.com',0,0, '/public_html/' . $subdomain . '/'));

and here is what I'm trying to use to issue certificates:

$xmlapi = new xmlapi('server ip');
$xmlapi->set_port( 2083 );
$xmlapi->password_auth($cpanelusr,$cpanelpass);
$xmlapi->set_debug(0);
$result = $xmlapi->api1_query($cpanelusr, 'letsencrypt', 'issue', array($subdomain,'mydomain.com',0,0, ''));

screenshot of the interface

Robin Daugherty
  • 7,115
  • 4
  • 45
  • 59
Bradley
  • 132
  • 3
  • 15
  • Good code snippets and description; can you include the specific error/problem that you're currently encountering? –  Jun 06 '16 at 17:09
  • That's the thing.. I'm not getting any errors in my errorlog... It's simply not working – Bradley Jun 07 '16 at 10:04

0 Answers0