logo
  • Home
  • Features
  • Screenshots
  • API
  • Demo
  • Free Trial
  • Purchase
  • Resellers
  • Installation
  • Contact us
Customer Login

API documentation

Note: This API is only for whmphp version 5 and above.

For WHMCS Module please refer this page


Right now, the API functions are designed only for Master Resellers to perform operation on their resellers

API URL : http://serverip:2082/frontend/x3/master/api.php , where x3 is the cPanel theme of the account.
Method : POST or GET

Example usage ( Logic )
Required values : cPanel username, ServerIP/domain, cPanel password.
Conditions : The user must have Reseller as well as Master Reseller permission
Connect to WHM XML API and get user's cPanel theme
Connect to cPanel WHMPHP api and call the function

Example Usage ( PHP code )

<?php
$serverip ="serveriphere" ;
$cpanel_username = "user" ;
$cpanel_password = "password" ;
$request = "/xml-api/accountsummary?user=$cpanel_username";
$output = connect_whm( $request,$serverip,$cpanel_username,$cpanel_password) ;

/* connect_whm is a function that will connect to WHM using the username/password provided and return the XML result as Array */
$theme = $output['accountsummary']['acct']['theme']; // x,x2,x3,x3mail or xmail

$request = "/frontend/$theme/master/api.php?action=listresellers";
$output = connect_cpanel($request,$serverip,$cpanel_username,$cpanel_password) ;

/* as you can guess, connect_cpanel is a function that will connect to the users cPanel account and get the XML result from the whmphp api as array

if ($output['whmphp']['status'])
{
// Success, do whatever you want here
echo $output['whmphp']['statusmsg']; // return succes message
}
else
{
// failed, so return the error
echo $output['whmphp']['statusmsg'];

}

?>

 

Create Reseller

Input action createreseller
  domain Doman name of reseller
  username Username of reseller
  password Password of reseller
  email Email Address of reseller
  package Package Name
     
Output    
  statumsg Normal cPanel account creation messages
  status 0/1

List Resellers

Input action listresellers
     
     
Output    
  reseller list of resellers

Suspend Reseller

Input username Username of reseller*
  action suspendreseller
     
     
Output    
  statumsg
  • The reseller has been suspended
  • This account is locked. Please contact system administrator
  status 0/1

Unsuspend Reseller.

Input username Username of reseller*
  action unsuspendreseller
     
Output    
  statumsg
  • The reseller has been unsuspended
  • This account is locked. Please contact system administrator
  status 0/1

Terminate Reseller

Input username Username of reseller*
  action terminatereseller
     
Output    
  statumsg
  • The reseller has been removed
  • You can not terminate your own account
  status 0/1

Change Reseller Password

Input username Username of reseller*
  password New password
  action changepwd
Output    
  statumsg
  • The password has been changed successfully
  • The password may not contain the username for security reasons
  • Password must be at least 5 characters
  • The user does not exist
  status 0/1

Set Limits and Overselling

Input username Username of reseller*
  action setlimit
  limit Interger
  band Interger
  disk Interger
  oversell_disk Boolen ( 0 - disable , 1 - enable )
  oversell_bw Boolen ( 0 - disable , 1 - enable )
  ns1 String
  ns2 String
     
Output    
  statumsg
  • Limit Set
  status 0/1

 

 


ABOUT US

WHMPHP A software by Zend Softwares Private Limited.
Contact support@whmphp.com , Terms of Service

CONTACTS

If you have a new idea to tell us, or just need to hear a friendly voice feel free to contact us anytime.

 


© Zend Softwares Private Limited. All rights reserved