MITHA API AAPANEL v0.1 (PHP) based from API documentation (unfinished) from aaPanel_Jose : https://forum.aapanel.com/d/482-api-interface-tutorial
first build : 08/14/2022
minor update : 09/05/2022
if anyone wants to help develop, i'm very grateful
===================================
for first time you must enable API in aapanel (Settings > Global > API > enable)
set > API secret key RESET > confirm
IP whitelist > input your public IP
save
===================================
create new file must contain :
include_once 'api/api_aapanel_mitha.php';
$aapanel = new aapanel_api;
$aapanel->key = 'YOUR API KEY';
$aapanel->url = 'YOUR AAPANEL IP AND PORT';
==================================
method list :
$aapanel->logs();
$aapanel->addSite($domain, $path, $desc, $type_id = 0, $type = 'php', $phpversion = '73', $port = '80', $ftp = null, $ftpusername = null, $ftppassword = null, $sql = null, $userdbase = null, $passdbase = null, $setSsl = 0, $forceSsl = 0);
$aapanel->addSubDomain($subdomain,$maindomain,$iptarget);
$aapanel->deleteSubDomain($subdomain, $mainDomain, $iptarget);
$aapanel->modifySubDomain($subdomain, $mainDomain, $iptarget, $id)
$aapanel->unzip($sourcefilepath,$destinationpath,$password = null);
$aapanel->forceHTTPS($sitename);
$aapanel->applySSL($domain, $id_site);
$aapanel->siteList($limit,$page,$search = null);
$aapanel->disableSite($id_site,$domain);
$aapanel->enableSite($id_site,$domain);
$file = complete path
$aapanel->importDbase($file, $dbasename);
$aapanel->safeFileBody($databody,$filepath);