Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

API2 - Parking Domain Problem

Discussion in 'cPanel Developers' started by eddit, Jul 5, 2010.

  1. eddit

    eddit Registered

    Joined:
    Jul 5, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    I got adding & removing email addresses worked out this morning using xmlapi.php so pressed on to parking domains with the api and now can't figure out this error.


    xmlapi-Array
    (
    [cpanelresult] => Array
    (
    [error] => Error from park wrapper: The following domain is not configured for this account: example.com.example.com: @Cpanel:: DOMAINS=(example.com, demo1.example.com, demo2.example.com)
    [data] => Array
    (
    [0] => Array
    (
    [result] => 0
    [reason] => Error from park wrapper: The following domain is not configured for this account: example.com.example.com: @Cpanel:: DOMAINS=(example.com, demo1.example.com, demo2.example.com) )
    )

    [event] => Array
    (
    [result] => 1
    )

    [module] => Park
    [apiversion] => 2
    [func] => park
    )
    )


    And the code

    Code:
    include "xmlapi.php";
    
    $ip = "1.2.3.4";
    $account = "cpanelac";
    $account_pass = "letmein";
    $top = "example.com";
    $domain = "parkeddomain.co.uk";	
    				
    $xmlapi = new xmlapi($ip);
    $xmlapi->password_auth($account, $account_pass);
    				
    $result = $xmlapi->api2_query($account, "Park", "park", array(domain=>$domain,topdomain=>$top) );				
    				
    $json = json_decode($result, true);
    (and get the array above)
    
    I set the default to json instead of xml & port to 2083 in xmlapi.php
    Tried the $xmlapi->park() funtion too.
    Also changed my quote of parked domains from unlimited to 10000 just in case.
    Run out of ideas for making it work & no Google searches threw anything up.

    Edit: Forgot to mention I can add/remove parked domains through cPanel no problem.
     
    #1 eddit, Jul 5, 2010
    Last edited: Jul 5, 2010
  2. eddit

    eddit Registered

    Joined:
    Jul 5, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    Fixed it. Some caffeine and an afternoon nap sorted it out :)

    Basically the API2 documents are wrong - I tried the API1 docs and for API1 the topdomain var is for optionally adding subdomains, so trying API2 with just the domain I want to park = success.

    Code:
    $domain = "parkeddomain.co.uk";	
    $result = $xmlapi->api2_query($account, "Park", "park", array(domain=>$domain));
    The domain on which is parked is taken from $account - your cpanel account.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice