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.

xmlapi createacct "Sorry, that's an invalid domain"

Discussion in 'cPanel Developers' started by josemv666, Aug 26, 2012.

  1. josemv666

    josemv666 Registered

    Joined:
    Mar 19, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Using the script sample from your site, something like this works:
    PHP:
    $query "https://127.0.0.1:2087/xml-api/listaccts";
    But after fix some typos from Cpanel website following example still not working

    PHP:
    $query "https://127.0.0.1:2087/xml-api/createacct?
    username=microveg&
    plan=Hosting1&
    password=p4s+s!w0rd353&
    ip=n&
    cpmod=x3&
    contactemail=jvalle@elsuper.com&
    domain=microvegetales.com&
    useregns=0&
    reseller=0"
    ;
    And always returns same error, no matter if use a test domain or real like
    previous one, I tried several available domains:

    Two questions:
    1-do you you know what's wrong there?
    2-there is place where errors are listed with some kind of explanation about
    what they mean?

    Thanks for your help
    Jose
     
  2. charsleysa

    charsleysa Active Member

    Joined:
    Jul 18, 2011
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Palmerston North, New Zealand
    cPanel Access Level:
    Root Administrator
    Are you encoding the input to make sure it complies with URL formatting? If you are using that URL directly then it would cause problems because it has characters that affect the URL so you must use PHP functions to encode the input, the function is "urlencode".
    So you would use it something like this:
    $urlPassword = 'password='. urlencode($password) ;
    That would generate the correctly encoded password part of the query.
     
Loading...

Share This Page