WHM account creation using the cpanel api

manigandan

Member
Nov 12, 2010
7
0
51
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:
 
Last edited:

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
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&
[email protected][email protected]&
contact%20email=username%[email protected]&      <-- "[email protected]"
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
 

manigandan

Member
Nov 12, 2010
7
0
51
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
 

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
Houston, TX
cPanel Access Level
Root Administrator
Is there any thing that i need to change in the cpanel to allow the api to create an account?
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
 

manigandan

Member
Nov 12, 2010
7
0
51
Thanks for your support DavidN. I have got the result. Onceagain thanks for your help.


Regards,
manigandanta.
 
Last edited: