API call for "Park a Domain" in WHM (not cPanel)

mvirtue

Member
Sep 1, 2007
11
3
53
In WHM, there's a facility called "Park a domain", useful when the "Aliases" feature of cPanel can't do what you need. It's particularly useful in situations like this...

If I have a cPanel account called "abc", with domain name "abc.com", and I wish to create a parked domain called "abc.myotheraccount.com" to be parked on top of "abc.com" (and "myotheraccount.com" is in a SEPARATE cPanel account on the same server), then cPanel's "Aliases" system won't let you do this, of course. But this IS possible via the "Park a domain" facility in WHM. I use this feature A LOT.

I want to know how to do this in the API (any cPanel API - api1, api2 or UAPI). I've searched the docco, but all I've found is the "park" function, which is equivalent to the cPanel "Aliases" facility, NOT the "Park a domain" facility in WHM. I tried it anyway, and (as expected) it didn't work.

Does anyone know if this is possible via one of the APIs?

Thanks in advance,

Mark.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,243
463
Hello,

There's no corresponding WHM API 1 function. You'd need to enable the following option under the "Domains" tab in "WHM >> Tweak Settings" to allow the addition of subdomains of other domain names owned by different accounts on the server:

"Allow cPanel users to create subdomains across accounts"

This would allow you to use the following cPanel API 2 function:

cPanel API 2 Functions - Park::park - Software Development Kit - cPanel Documentation

Thank you.
 

nkuzman1

Registered
PartnerNOC
Jan 16, 2006
2
1
153
Pula, Croatia
cPanel Access Level
DataCenter Provider
Twitter
In WHM, there's a facility called "Park a domain", useful when the "Aliases" feature of cPanel can't do what you need. It's particularly useful in situations like this...

If I have a cPanel account called "abc", with domain name "abc.com", and I wish to create a parked domain called "abc.myotheraccount.com" to be parked on top of "abc.com" (and "myotheraccount.com" is in a SEPARATE cPanel account on the same server), then cPanel's "Aliases" system won't let you do this, of course. But this IS possible via the "Park a domain" facility in WHM. I use this feature A LOT.

I want to know how to do this in the API (any cPanel API - api1, api2 or UAPI). I've searched the docco, but all I've found is the "park" function, which is equivalent to the cPanel "Aliases" facility, NOT the "Park a domain" facility in WHM. I tried it anyway, and (as expected) it didn't work.

Does anyone know if this is possible via one of the APIs?

Thanks in advance,

Mark.

It can be done with HTTP GET request to the /scripts/park (including WHM authentication HTTP header):
https://server:2087/scripts/park?domain=main.com&ndomain=parked.com

It's not the proper API "way" but it works
 
  • Like
Reactions: cPanelMichael