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.

Problem parking a domain via API2 Park::park

Discussion in 'cPanel Developers' started by bmett, Jan 24, 2012.

  1. bmett

    bmett Well-Known Member

    Joined:
    Aug 5, 2010
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brisbane, AU
    Hi everyone,

    I'm using the cPanel APi successfully for many different functions: creating account, terminating accounts, DNS functions, etc.
    All runs perfectly fine as expected. Only the API2 function Park::park doesn't do what I want.

    Simple example:
    Existing account: domainname.com.au with acc name: domainna
    Domain I want to park on to of the existing account : domainname.com

    Both domains are under our management and point to the correct nameserver.

    I tried to use the API2 module Park with the function park to park the domain.

    PHP:
    $acc_name 'domainna';
    $dom_to_park 'domainname.com';
    $dom_top_name 'domainname.com.au';
    $xmlapi->api2_query($acc_name"Park""park", array(domain=>$dom_to_parktopdomain=>$dom_top_name);
    Unfortunately that doesn't work. I get the following error message:
    Code:
    {"cpanelresult":{"error":"Error from park wrapper: The following domain is not configured for this account: [B]domainname.com.au.domainname.com.au[/B]: @Cpanel::DOMAINS=(domainname.com.au)\\n","data":[{"result":0,"reason":"Error from park wrapper: The following domain is not configured for this account: domainname.com.au.domainname.com.au: @Cpanel::DOMAINS=(domainname.com.au)\\n"}],"event":{"result":1},"module":"Park","apiversion":2,"func":"park"}}
    
    The only thing in there that makes me wonder is the part I highlighted. Why is the domainname there twice (domainname.com.au.domainname.com.au)?

    And now the strange part.
    If I go into WHM and try to park the domain via DNS Functions > Park a Domain, it works fine.

    Hope someone can help.

    Cheers,
    Bjorn
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Is domain.com.au the primary domain on that cPanel account? If so, omit the topdomain parameter. Otherwise, from what I'm seeing in the documentation, it would need to be a subdomain (not something like domain.com.au but something like subdomain.domain.com.au).
     
    #2 cPanelDavidG, Jan 25, 2012
    Last edited: Jan 25, 2012
  3. bmett

    bmett Well-Known Member

    Joined:
    Aug 5, 2010
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brisbane, AU
    Hi David,

    Thanks for the reply.

    I think I figured it out (after your hint of course).

    After omiting the topdomain paramter I got a different error:

    So I just added our nameserver IPs to IP Functions >> Configure Remote Service IPs in WHM and after that the parking worked. :D

    Thanks David, as always: Awesome support!

    Cheers,
    Bjorn
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Ahh, good point.

    I'm going to speak with one of our guys to see if we can get a blog written on this topic as this seems to be a common stumbling point based on what I've addressed on the forums in the past few weeks :).
     
Loading...

Share This Page