Whm Cpanel Park API not allowing to park a domain on an existing subdomain

djow

Registered
Aug 11, 2011
4
0
51
I'm trying to use the Xml API, to park a domain (example.com) to an existing subdomain (sub.anotherdomain.com).

maindomain.com is the main domain registered for my user (reseller account)
anotherdomain.com is an already parked domain, and it points to maindomain.com
sub.anotherdomain.com is an existing and active subdomain

when I try to park another domain (example.com) to point to sub.anotherdomain.com, using:

$xmlapi->api2_query($username,'Park', 'park', array('domain'=>'anotherdomain.com','topdomain'=>'sub.anotherdomain.com'));
or
$xmlapi->api1_query($username,'Park', 'park', array('anotherdomain.com','sub.anotherdomain.com'));

I get an error message:
sub.anotherdomain.com.maindomain.com is not a valid domain name

No matter what I do, It always append the maindomain.com to the topdomain parameter.

Using de WHM UI > DNS Functions > Park a Domain, it works fine.

How can I resolve this, calling the API?

Thanks in advance

ApiPark < ApiDocs/Api1 < TWiki
ApiPark < ApiDocs/Api2 < TWiki
 

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
Houston, TX
cPanel Access Level
Root Administrator
Hi djow,

In your arguements to the API2 Park::park, 'topdomain' should simply be 'sub' (and not the fully qualified subdomain).

Regards,
-DavidN
 

djow

Registered
Aug 11, 2011
4
0
51
Hi CPanelDavidN,

thanks for the reply, but if I put only 'sub', it points to the wrong subdomain: sub.maindomain.com
I need to point to sub.anotherdomain.com not the sub.maindomain.com, is it possible?

Regards
 

djow

Registered
Aug 11, 2011
4
0
51
WHM 11.30.2 (build 1)
CLOUDLINUX 5.6 x86_64 standard

cPanel Version11.30.2.1

Regards
 

djow

Registered
Aug 11, 2011
4
0
51
Re: Whm Cpanel Park API not allowing to park a domain on an existing subdom

Is there any solution for this, or is this a bug on the API?

Thanks