It did not, upon looking at the CWP Module for Blesta included with the latest version. It is clearly different to what is currently implemented.
/home/webytely/public_html/dashboard/components/modules/centoswebpanel/apis/centoswebpanel_api.php
public function apiRequest($function, array $params = [])
{
// Set api url
$protocol = ($this->use_ssl ? 'https' : 'http');
$port = ($this->use_ssl ? '2031' : '2030');
$url = $protocol . '://'
. $this->hostname . ':' . $port
. '/api/?key=' . $this->key
. '&api=' . $function
. '&' . http_build_query($params);
// Send request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = $this->parseResponse(curl_exec($ch));
curl_close($ch);
return $data;
}
And what CWP Provided as an Example:
$data = array(“key” => “MYKEY”,”action”=>’add’, ”domain”=>’MY_DOMAIN’, ”user”=>’USER’, ”pass”=>’PASSWORD’, ”email”=>’email@account’, ”package”=>’PACKAGE_NAME’, ”inode”=>’0’,”limit_nproc”=>’40’,”limit_nofile”=>’0’,”server_ips”=>’MY_IP_SERVER’);
$url = “https://IPSERVERAPI:2304/v1/account”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt ($ch, CURLOPT_POST, 1);
$response = curl_exec($ch);
curl_close($ch);
Based on the new revisions provided here:
https://docs.control-webpanel.com/docs/developer-tools/api-manager/functions/function-api-account/add
So Essentially, this made the Error 500 problem since the server isnt responding due to a wrong api method being used. Not even using port 2304 on the latest blesta update.
Can we get this bumped to a developer at blesta to take a look.
Thanks