how used
my cpanel version 82.0.15
the result will
please replay me what i change the code
Code:
$server_login_link = '******';
$whmusername = '******';
$hash = '******';
$query = "[URL]https://example.com:2087/cpsesss_HJXX,TTX8H/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=MysqlFE&cpanel_jsonapi_func=createdb&db=example_database[/URL]";
$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
$header[0] = "Authorization: WHM $whmusername:" . preg_replace("'(\r|\n)'","",$hash);
curl_setopt($curl,CURLOPT_HTTPHEADER,$header);
curl_setopt($curl, CURLOPT_URL, $query);
$result = curl_exec($curl);
print_r(json_decode($result));
the result will
Code:
// stdClass Object ( [cpanelresult] => stdClass Object ( [apiversion] => 2 [error] => Access denied [data] => stdClass Object ( [reason] => Access denied [result] => 0 ) [type] => text ) )
please replay me what i change the code
Last edited by a moderator: