Skip to content

Instantly share code, notes, and snippets.

@sdieunidou
Created September 13, 2021 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdieunidou/6e730e9a8e3e938e12764089528ba5b9 to your computer and use it in GitHub Desktop.
Save sdieunidou/6e730e9a8e3e938e12764089528ba5b9 to your computer and use it in GitHub Desktop.
apiscp soap example
<?php
$endpoint = 'https://myapiscpurl:2083';
$key = 'myapikey';
$client = new \SoapClient(
$endpoint . '/apnscp.wsdl',
array(
'connection_timeout' => 5,
'location' => $endpoint.'/soap?authkey='.$key,
'uri' => 'urn:net.apnscp.soap'
)
);
$rand = random_int(0, 9999999);
var_dump(
call_user_func(
[
$client,
'admin_add_site',
],
'testgratuit' . $rand . '.myndd.com',
'testgratuit' . $rand,
[
'siteinfo,plan' => 'basic',
'siteinfo,email' => 'contact@myndd.com',
'dns,provider' => null,
'apache,webserver' => $rand . '.myndd.com',
'ftp,ftpserver' => $rand . '.myndd.com',
'billing,invoice' => 'invoice-' . $rand,
],
[
'notify' => true,
]
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment