Hello,
I recently configured a virtual host template successfully applied to any new domain created manually in Plesk. When I use the Plesk REST API to create domains, the virtual host template is not applied. Is it possible to apply a virtual host template on API created domains?
Here's my current PHP API call function:
function createDomain($domain, $secretKey, $parentDomainGuid, $ownerClientGuid, $ipv4, $ipv6, $domainId){
$url = "https://" . $domain . ":8443/api/v2/domains";
$folder = $this->account->install_folder;
$request = array (
'name' => $folder . ' . ' . $domain,
'hosting_type' => 'virtual',
'hosting_settings' =>
array (
"www_root" => 'httpdocs/' . $folder,
'certificate_name'=> 'Lets Encrypt ' . $domain
),
'parent_domain' =>
array (
'id' => $domainId,
'name' => $domain,
'guid' => $parentDomainGuid,
),
'owner_client' =>
array (
'id' => 1,
'login' => 'admin',
'guid' => $ownerClientGuid,
'external_id' => '',
),
'ipv4' =>
array (
0 => $ipv4,
),
'ipv6' =>
array (
0 => $ipv6,
),
'plan' =>
array (
'name' => 'Unlimited',
),
);
}
Thanks in advance!
jPG
I recently configured a virtual host template successfully applied to any new domain created manually in Plesk. When I use the Plesk REST API to create domains, the virtual host template is not applied. Is it possible to apply a virtual host template on API created domains?
Here's my current PHP API call function:
function createDomain($domain, $secretKey, $parentDomainGuid, $ownerClientGuid, $ipv4, $ipv6, $domainId){
$url = "https://" . $domain . ":8443/api/v2/domains";
$folder = $this->account->install_folder;
$request = array (
'name' => $folder . ' . ' . $domain,
'hosting_type' => 'virtual',
'hosting_settings' =>
array (
"www_root" => 'httpdocs/' . $folder,
'certificate_name'=> 'Lets Encrypt ' . $domain
),
'parent_domain' =>
array (
'id' => $domainId,
'name' => $domain,
'guid' => $parentDomainGuid,
),
'owner_client' =>
array (
'id' => 1,
'login' => 'admin',
'guid' => $ownerClientGuid,
'external_id' => '',
),
'ipv4' =>
array (
0 => $ipv4,
),
'ipv6' =>
array (
0 => $ipv6,
),
'plan' =>
array (
'name' => 'Unlimited',
),
);
}
Thanks in advance!
jPG