Are There Any API Example Scripts For Use?

Visad182

Member
Sep 8, 2017
10
0
1
Canada
cPanel Access Level
Website Owner
Hello,

I just updated WHM and i realized that XML API is no longer supported for WHM.

So i have to switch to WHM API 1, but how can it be so dificult to find a starting script. I mean, a PHP script as exemple to call API ?

This is crazy how you should be a verry experienced programmer to use your API and should not.

So my question is, i want to create cPanel account from WHM, but can't find ANY ANY ANY ANY script into cPanel doc for PHP, so how get started ?

Can i have an demo.

I can understand that we are alot of people who's paying for cPanel license for 37 USD each month, but there no support except forum. How could it be possible ?

I hope to get a nice answer like most of time with cPanel staff.

Thanks alot
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
363
Hello @Visad182,

You can find a PHP client class for use with API functions at:

CpanelInc/xmlapi-php

It includes some examples to help you get started. Note the following on the above page:

As of version 74, the XML serialization is no longer available in cPanel & WHM. However, despite the name of this package and the fact that it is obsolete, it should be possible to use this package with the JSON serialization (and only the JSON serialization) in version 74 and newer.
Here's a link to the WHM API 1 function you'd use to create the account:

WHM API 1 Functions - createacct - Developer Documentation - cPanel Documentation

Thank you.