Can you give an example of how a user (non-reseller) would connect to the API? I've tried dozens of combinations but always get an "Access denied" response.
Code:
include("xmlapi.php");
$ip = "my-domain.com";
$my_pass = "mypassword";
$my_login = "johndoe"
$account = "johndoe";
$email_user = "somerandomuser";
$email_password = "adfm90f1m3f0m0adf";
$email_domain = "somedomain.com";
$email_query = '10';
$xmlapi = new xmlapi($ip);
$xmlapi->set_port(2083);
$xmlapi->password_auth($my_login, $root_pass);
$xmlapi->set_output('json');
$xmlapi->set_debug(1);
print $xmlapi->api1_query($account, "Email", "addpop",
array($email_user, $email_password, $email_quota, $email_domain)
);
This returns
{"data":{"reason":"Access denied","result":"0"},"type":"text"}
- For a non-reseller, is the username in password_auth() the same as the $account?
- In the browser, my cpanel connects to port 2082. Should I be using this port?
Thanks for any help! For now I'm going back to the scraping method (from this thread), but I'd feel better using the API.