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.

WHM account creation using the cpanel api

Discussion in 'cPanel Developers' started by manigandan, Jan 18, 2011.

  1. manigandan

    manigandan Member

    Joined:
    Nov 12, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi all,

    I'm getting the following error while trying to create an account using the cpanel api which is https://example.com:2087/xml-api/cr....tld&domain=domain.tld&useregns=0&reseller=0 .

    and the error is: Array ( [result] => Array ( [0] => Array ( [status] => 0 [statusmsg] => Sorry, that's an invalid domain [rawout] => [options] => ) ) )

    i have given all the parameters correctly.
    Do i need to change any setting in the cpanel to allow api account creation.:confused::mad:
     
    #1 manigandan, Jan 18, 2011
    Last edited: Jan 19, 2011
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi manigandan,

    The domain in your example looks fine. However, the example does look like there might be other issues. Below I've broken the URL into pieces; the "contact email" key needs to be one word (ie, 'contactemail') and the email address will need to not have a space either.
    Code:
    [url]https://example.com:2087/xml-api/createacct?[/url]
    username=myuser&
    plan=basic%20&
    ip=n&
    cpmod=x3&
    password=h@rd2gu3ss!p@ss&
    contact%20email=username%20@domain.tld&      <-- "contactemail=username@domain.tld"
    domain=domain.tld&
    useregns=0&
    reseller=0
    
    Other than that, nothing stands out that could be causing this.

    Ensure that all you parameters are correct. If one parameter is off, it could throw the rest off too.

    Regards,
    -DavidN
     
  3. manigandan

    manigandan Member

    Joined:
    Nov 12, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi DavidN,

    Thanks for your reply. I have corrected that issue and checked all the parameters that i'm using with the api. All parameters are correct only. Is there any thing that i need to change in the cpanel to allow the api to create an account?

    Regards,
    manigandanta
     
  4. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Nope. As long as you are authenticated as root or a reseller (with the proper permissions respective of the action you are performing) then you can utilized the XML-API to its full capacity, just like WHM.

    Are you still getting the same error message?

    Regards,
    -DavidN
     
  5. manigandan

    manigandan Member

    Joined:
    Nov 12, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your support DavidN. I have got the result. Onceagain thanks for your help.


    Regards,
    manigandanta.
     
    #5 manigandan, Jan 20, 2011
    Last edited: Jan 20, 2011
Loading...

Share This Page