The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'cPanel Developers' started by mvirtue, Mar 2, 2017.

  1. mvirtue

    mvirtue Member

    Joined:
    Sep 1, 2007
    Messages:
    8
    Likes Received:
    2
    Trophy Points:
    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.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    35,630
    Likes Received:
    1,135
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  3. mvirtue

    mvirtue Member

    Joined:
    Sep 1, 2007
    Messages:
    8
    Likes Received:
    2
    Trophy Points:
    53
    Thanks Michael. That's great.
     
    cPanelMichael likes this.
  4. nkuzman1

    nkuzman1 Registered
    PartnerNOC

    Joined:
    Jan 16, 2006
    Messages:
    1
    Likes Received:
    1
    Trophy Points:
    153
    Location:
    Pula, Croatia
    cPanel Access Level:
    DataCenter Provider
    Twitter:

    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
     
    cPanelMichael likes this.
Loading...

Share This Page