Adding an Add-on Domain with the API (CMD_API_ADDITIONAL_DOMAINS)

Kadir Ülger

Verified User
Joined
Dec 27, 2020
Messages
13
Location
Istanbul
Hello, I can add a new domain with the command https://tinyurl.com/y88ryd5q CMD_DOMAIN as in the link below.

But what I want is to add an add-on domain with the CMD_API_ADDITIONAL_DOMAINS command.

To do this I searched for sample php code but couldn't find it. Can you please help with this?
 
I finally did. The command I need is CMD_API_DOMAIN_POINTER. I've been looking for the solution far away :)

<?php
include 'httpsocket.php';
$sock = new HTTPSocket;
$sock->connect('ssl://hostname.com',2222);
$sock->set_login("admin","password");
$sock->set_method('POST');
$sock->query('/CMD_API_DOMAIN_POINTER',
array(
'domain' => 'maindomain name',
'action' => 'add',
'from' => 'addon domain name',
'alias' => 'yes'
));
$result = $sock->fetch_body();
echo $result;
?>
 
Back
Top