Sentora Support Forums

Full Version: Sentora API???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, how can I access Sentora's API? I went through the Developer's Guide, and I found this link: http://developer.zpanelcp.com/api/

However it is dead. I'm wondering what the functions are. I'm hoping to automate a user creation based on a certain package and offer free web-hosting using Sentora as a control panel!

If you could provide me with the API documentation, or even the function/example on how to do this, that'd be great, thanks!
https://github.com/bobsta63/xmws-php-client

This is what I was looking for, already has the functions so I don't have to create my own. Thank you for the reply though.

I seem to have ran into an error using the official PHP API?
Code:
Warning: Missing argument 1 for xmwsclient::__construct(), called in C:\xampp\htdocs\sentora\create.php on line 3 and defined in C:\xampp\htdocs\sentora\xmwsclient.class.php on line 28 Warning: Missing argument 2 for xmwsclient::__construct(), called in C:\xampp\htdocs\sentora\create.php on line 3 and defined in C:\xampp\htdocs\sentora\xmwsclient.class.php on line 28 Fatal error: Call to private method xmwsclient::BuildRequest() from context '' in C:\xampp\htdocs\sentora\create.php on line 36

Line #36 is
Code:
$auto_prepared_xml = $xmws->BuildRequest();
Advice do tests on linux first.

M B
I emailed Ballen, and he told me I was executing the xmws client wrong. I'm assuming it was changed somewhere down the line because none of his example codes work either (same error as this), but changing it the way he told me fixed the first two errors (the warnings)

You'll see this code to initiate it in the wiki/examples:
Code:
$xmws = new xmwsclient(); $xmws->serverkey = "blah blah blah"
and the panel url is also there.

He advised me the correct way to do is
Code:
$serverkey = "**********"; $panelurl = "http://*******"; $xmws = new xmwsclient($panelurl,$serverkey);
or just filling it in as a variable.

I still have the fatal error, and I'll update that as soon as we figure out what is going on here.
Don't know if it helps but this is an example that works with XMWS..
I myself am not so knowledgeable about XMWS to give more information about this but maybe you can get some (working) information from it. Smile
You still having the issue with this hjon96? - As per my last email to you I changed the method visibility on the BuildRequest() to public of which should have resolved this error for you.

As per Ron-e's response above, I can confirm that the version of the XMWS client you have been using is NEWER than the one as part of the example link that Ron-e has posted above but like I said in my last email I updated the library code on GitHub so it should work fine now.

I've also been working on a new XMWS client of which is available here: - https://github.com/bobsta63/senitor Some of the examples won't work until the next release of Sentora as I've made some updates to the core of Sentora.
(03-22-2015, 05:03 AM)ballen Wrote: [ -> ]You still having the issue with this hjon96? - As per my last email to you I changed the method visibility on the BuildRequest() to public of which should have resolved this error for you.

As per Ron-e's response above, I can confirm that the version of the XMWS client you have been using is NEWER than the one as part of the example link that Ron-e has posted above but like I said in my last email I updated the library code on GitHub so it should work fine now.

I've also been working on a new XMWS client of which is available here: - https://github.com/bobsta63/senitor Some of the examples won't work until the next release of Sentora as I've made some updates to the core of Sentora.

Yes, I sent you an email on March 18, I don't think you received it. The account is failing to create but is giving a success code.