HI
i'd created separate post for the my problem, But I see that discussion about xmlapi is in this thread
Here
http://forums.cpanel.net/f42/xmlapi-...tml#post647589
is my original post
HI
i'd created separate post for the my problem, But I see that discussion about xmlapi is in this thread
Here
http://forums.cpanel.net/f42/xmlapi-...tml#post647589
is my original post
The sun will shine for you, while you will shine for Sun.
Hi, can someone post a valid link to download the API class?
Thanks,
Darren
Hi Darren,
You can find the downloads here by version:
Index of /lib/xmlapi/php
Cheers
Hi, I have decided to use cURL with the API because the PHP script is very insecure in wanting to pass the root password in clear text. I used a remote access key instead over SSL.
You might want to re-read the xml-api class docs.
I'm using the xml-api class with ssl and root user and a provided hash.
In the class tarball see:
xmlapi_php/hashauth_example.php
Matt Dees
Question: hope so every one knows Rvsitebuilder when you setup that it ask which DB you want to create and what will be DB username and Password and finaly when you provide and press button it automaticaly create DB, DB user, password and also authenticate user over DB my question is how all over cpanel forum an api ask hask key, root username and password for doing any action related to whm than why and how rvsitebuilder not ask and it do all quick quick? I am also willing to build a plugin which i install inside my WHM and using it i can run any command or action which WHM does but main thing i don't want to put or provide WHM root password or remote access key. Is it possible ???
Hi,
I try to use this class on my HostGator server but it doesn't work. Maybe someone who has an reseller account can say how to configure this connection.
I've done that:
Nothing happens.PHP Code:include_once 'xmlapi.php';
$user = ""; // the main account username
$ip = ""; // the account IP address
$hash = ''; // hash provided in whm
$xmlapi = new xmlapi($ip);
$xmlapi->hash_auth($user,$hash);
$xmlapi->set_http_client('fopen');
$xmlapi->set_debug(1);
print $xmlapi->api2_query($user, "Email", "listpopswithdisk");
When fopen is activated, I get this warning :
Code:...failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in...
1) Do you have (normal) access to WHM?
2) Did you enter the following correctly?
user = your WHM user_idCode:$user = ""; // the main account username $ip = ""; // the account IP address $hash = ''; // hash provided in whm
ip= IP-address to access WHM
hash = the complete hash which is found in your remote access settings
Hi,
This is probably not related to the API; but then again - it might be...
We want to offer our customers DNS hosting with their domain name registrations. Therefor, we want to add the DNS zones to our main cpanel controlled cluster, so we can use the same nameservers.
Because we want to avoid that a client accidentally deletes a DNS zone he hosted, but which meanwhile was tied to a hosting account, we want to put all these DNS zone under a reseller account that we created just for this.
The reseller account has the add/removed/edit/park features added to his account, and when I log in to WHM using the reseller account, I can in fact create DNS zones, update them and delete them.
However, the API returns that we have no privilege...
CODE:
The result of the above code is:Code:include("xmlapi.php"); // Initialise the API $xmlapi = new xmlapi("serverName", "dnszone", "secret_password"); // Force output to be JSON $xmlapi->set_output("json"); echo $xmlapi->adddns("somedns3.be", "123.52.62.45");
It's probably an issue with the internals of the API in cPanel and not su much with this class, as I can make the call correctly, but I hope someone may know what is causing this...Code:{"status":0,"statusmsg":"Permission Denied"}
Not sure if something is wrong with the permissions.
I have created a reseller account (using whm) and given it all permissions (apart from root permissions)
However when using the api this account doesn't have all the permissions it should have. I only need a few functions but, of, course the one i don't have permissions for is the removeacct (to delete account). Which it definitely has privileges to do!
I dont know if this is the api's fault or the class' (prob api?) but i cant seem to fix it. Its there if im root user or give the reseller account root access. I just dont want to give root access to the script "Just in Case".
sigh,
been working on making this script most of the day would really appreciate some help on it
ty guys![]()
Last edited by helium; 05-21-2010 at 11:43 AM.
Helium,
Seems to work for me for a reseller with all boxes checked except the 'everything' root access
response:Code:<?php //setup and vars include("xmlapi.php"); $ip = "192.168.168.1"; $root_pass = "rootsecret"; $reseller = 'fptest'; $reseller_pass = 'resellersecret'; $acct = array( 'username' => "someone", 'password' => "pass123", 'domain' => "thisdomain.com"); //instantiate and use root to remove the account, if it already exists $xmlapi = new xmlapi($ip); $xmlapi->password_auth("root",$root_pass); $xmlapi->removeacct('someone'); //change auth and create account $xmlapi->password_auth($reseller,$reseller_pass); $result = $xmlapi->createacct($acct); //set debugging on and do the "real" test for this scenario $xmlapi->set_debug(1); $result = $xmlapi->removeacct('someone'); ?>
Code:[status] => 1 [statusmsg] => someone account removed
David Neimeyer
Integration Developer
sdk.cpanel.net
APIs: XML-API API1 & API2
Check Out: Developer Downloads Integration Blog
Need Support? Support Ticket Developer Forum Feature Requests
Hi Speedpacket,
This is a know issue and a fix is in the works for the xml-api binary to address this exact issue. To be clear, this has nothing to do with the PHP client class used in making the xml-api request to the server. Your code is sound.
Regards,
-DavidN
David Neimeyer
Integration Developer
sdk.cpanel.net
APIs: XML-API API1 & API2
Check Out: Developer Downloads Integration Blog
Need Support? Support Ticket Developer Forum Feature Requests
--- moved ---
Last edited by CaMer0n; 06-15-2010 at 11:42 PM.
Is there any way to access PEAR or install PEAR packages through the api?