Need help with XML API
Please am New here. How can I get the cpanel xmlapi scripts?
-
Hello, The following document is a good place to start: Developer Documentation Home - Developer Documentation - cPanel Documentation Note that it's a good idea to use JSON instead of the XML-like output of our APIs. See the following quote from our 0 -
Yes, well, some helpful individual killed all the original in-links to the documentations from google. Even on the page you link EVERY SINGLE link is broken and redirects (301 Moved Permanently) to /DD. Awesome. 0 -
Even on the page you link EVERY SINGLE link is broken and redirects (301 Moved Permanently) to /DD.
This may be related to this: Where's the SDK? | cPanel Blog Do these links work for you? Developer Documentation Home - Developer Documentation - cPanel Documentation0 -
Hi @bouvrie, I apologize, it looks like the URL I provided you was updated shortly after I sent the response. This is referenced in the blog post that @Infopro mentioned in the previous post. As noted, here's the link you are looking for: Developer Documentation Home - Developer Documentation - cPanel Documentation I've updated my previous response to reflect the new URL. Thank you. 0 -
You know, its really not that I have not really read that documentation several times but I seem not to add the pieces together. Especially how do I connect to cpanel remotely and that goes to WHM as well. Because if I can connect properly then I use php to do things like create cpanel account, or create email accounts or even mysql db. In some of your old thread like as of June 25 2017. You pointed some people to your xmlapi-php at Github is that file still OK to use? I saw it was last updated 2016, if am correct. If its not, please help point to the best way I can connect to cpanel, and WHM to be able to use api2 and uapi for cpanel and api1 for WHM. Thanks 0 -
Hello, If the custom script you are developing is hosted on a remote server, then you'd need to configure the script to connect to the IP address of the cPanel server as opposed to "localhost" or "127.0.0.1". We provide a list of available authentication methods at: Additionally, if you plan to develop your script in PHP, you may find the following user-submitted UAPI PHP class helpful: 0 -
Hello, If the custom script you are developing is hosted on a remote server, then you'd need to configure the script to connect to the IP address of the cPanel server as opposed to "localhost" or "127.0.0.1". We provide a list of available authentication methods at: Thank you.
Thank you for your response. Am I interested in Hash, Username & Password and Api Tokens authentications. Now from what I understand from your documentation, api token is used mainly for WHM api 1 calls. E.g Now from here, am OK with WHM authentication and how to make a call to it. But for cpanel, am not so sure. The links below treated Hash, Username & Password but gave examples with WHM, could you please use any cpanel call, like maybe 'addpop' to make an example. So that I can see how cpanel is authenticated. So, if you won't mind could you show me an example call in cpanel that uses the example in the link above. Not that I don't appreciate other class from people who have done this, but I really want to understand your documentation, so that I could use it properly. Hope you understand me question. Warm Regards0 -
But for cpanel, am not so sure. The links below treated Hash, Username & Password but gave examples with WHM, could you please use any cpanel call, like maybe 'addpop' to make an example. So that I can see how cpanel is authenticated.
Hello, The Access Hash Authentication method is only available for WHM authentication. If you are looking to authenticate with the cPanel username and password, then you'd need to modify the example provided on
As far as the following line:$query = "https://127.0.0.1:2083/execute/Email/list_pops";
I recommend enabling the following option under the "System" tab in "WHM >> Tweak Settings": cPanel & WHM API shell (for developers) This will allow you to access the "API Shell" option from within cPanel for an account with reseller privileges (you can create a test account for this purpose). The API Shell option in cPanel will help you formulate the correct URL. Thank you.0 -
Thank you for the messa Hello, The Access Hash Authentication method is only available for WHM authentication. If you are looking to authenticate with the cPanel username and password, then you'd need to modify the example provided on
As far as the following line:$query = "https://127.0.0.1:2083/execute/Email/list_pops";
I recommend enabling the following option under the "System" tab in "WHM >> Tweak Settings": cPanel & WHM API shell (for developers) This will allow you to access the "API Shell" option from within cPanel for an account with reseller privileges (you can create a test account for this purpose). The API Shell option in cPanel will help you formulate the correct URL.
Thank you so much. Please I really need your help with these issues: Please am on VPS hosting. And I wish to use it to create sites for client using cpanel and WHM api. 1.How can I make my server secure for production, I.e hosting site for my clients. Or better still what are the basic settings in need to put in place in WHM for my server to be secure considering that I should be able to use cpanel and WHM api. 3. If I signup for the vps using mysite.com for example, I found out that in mysite.com I can use the WHM api1 to create cpanel accounts, following the Tweak setting you mentioned above. But I will need more than one skeleton directory, that necessitated my need to create a reseller. But i was unable to locate /root/cpanel-skel-3 in neither mysite.com nor its reseller. How can I solve this issue? And must I only run this WHM api in mysite.com can I run it in another site I created maybe a reseller, and then provide the root hash? Thanks you so much for your assistance. I appreciate.0 -
.How can I make my server secure for production, I.e hosting site for my clients. Or better still what are the basic settings in need to put in place in WHM for my server to be secure considering that I should be able to use cpanel and WHM api.
The following document is a good place to start: Tips to Make Your Server More Secure - cPanel Knowledge Base - cPanel Documentation. If I signup for the vps using mysite.com for example, I found out that in mysite.com I can use the WHM api1 to create cpanel accounts, following the Tweak setting you mentioned above. But I will need more than one skeleton directory, that necessitated my need to create a reseller. But i was unable to locate /root/cpanel-skel-3 in neither mysite.com nor its reseller. How can I solve this issue? And must I only run this WHM api in mysite.com can I run it in another site I created maybe a reseller, and then provide the root hash?
You can run WHM API 1 functions as root or as a reseller, as long as the the reseller has the corresponding feature assigned as a privilege. The reseller skeleton directory is located in a separate location compared to the root skeleton directory: /home/resellerusername/cpanel3-skel/public_html/ This is documented at: Skeleton Directory - Version 70 Documentation - cPanel Documentation Thank you.0 -
Hello thank you for your response, it was very helpful. I am trying to use the fileman::upload_files function, the tutorial at Tutorial - Use UAPI's Fileman::upload_files Function in Custom Code - Developer Documentation - cPanel Documentation worked perfect for me. but i have the following concerns: - Using the tutorial for my needs will make me store cpanel password say in db which is not a secure approach for me. - Am trying to call that function from WHM just like i have been doing to others with success, but for this fileman::upload_files function, i keep getting "You must specify at least one file to upload." I have read through the forum about fileman::upload_files function i found some users with the same issue for whose case has not been solved. Now my questions are: - Is there a way to make the tutorial at Tutorial - Use UAPI's Fileman::upload_files Function in Custom Code - Developer Documentation - cPanel Documentation, to use another form of authentication that will not require the use of cpanel password? - Why is the function not working in WHM api call? Am thinking that why this function is not working when called through WHM could be related to the authentication, though i could be wrong, but what could be the possible solution. Regards 0 -
- Am trying to call that function from WHM just like i have been doing to others with success, but for this fileman::upload_files function, i keep getting "You must specify at least one file to upload."
Hello, This was brought up in the past as part of an internal case (CPANEL-2806). Here's the response from Development: [QUOTE]This is by design. We disallow file uploads since the form is parsed (and the file stored in a temporary file) before privileges are dropped. When we go to actually run the function call as the user, the file is not accessible. We have to parse the form before dropping privileges in order to know what user we need to run as.
You'd need to run that UAPI function as the cPanel user. The Single Sign On method would allow you to authenticate as the cPanel user without using the account password: Guide to API Authentication - Single Sign On - Developer Documentation - cPanel Documentation WHM API 1 Functions - create_user_session - Developer Documentation - cPanel Documentation Thank you.0 -
Thank you so much, i now remember i have read about the single sign on. Thank you. 0
Please sign in to leave a comment.
Comments
13 comments