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

josemv666

Registered
Mar 19, 2008
2
0
51
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&
[email protected]&
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:

"Sorry, that's an invalid domain"
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
 

charsleysa

Active Member
Jul 18, 2011
41
0
56
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.