Adding Addon domain in an account

naviciroel

New member
Joined
Oct 31, 2014
Messages
1
Hi I've been having problems on adding addon domain in an account using the DA APi.

I can't get it working here's my code:


$sub = strstr($domain, '.', true) . '.' . $main_domain;
$api->server_connect();
$api->set_login($username, $password);
$api->set_method('POST');
$api->query('/CMD_SUBDOMAIN', array('action' => 'create', 'domain' => $domain, 'subdomain' => $sub));
$result = $this->fetch_body();


can someone explain why is it not working and help me how to make it work?
 
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