deadsik Posted March 27 Share Posted March 27 Hello, Can you please tell me, is it normal for GetClientPassword to return an empty string? WHMCS: 8.9.0 <?php // API Connection Details $whmcsUrl = "https://example.com/"; $api_identifier = "******"; $api_secret = "******"; // Set post values $postfields = array( // 'identifier' => $api_identifier, // 'secret' => $api_secret, 'username' => '******', 'password' => md5('******)'), 'action' => 'GetClientPassword', 'userid' => '1', 'responsetype' => 'json', ); // Call the API $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $whmcsUrl . 'includes/api.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields)); $response = curl_exec($ch); if (curl_error($ch)) { die('Unable to connect: ' . curl_errno($ch) . ' - ' . curl_error($ch)); } curl_close($ch); // Decode response $jsonData = json_decode($response, true); // Dump array structure for inspection var_dump($jsonData); ?> According to the documentation, it should return the encrypted password, but: $ php GetClientPassword.php array(2) { ["result"]=> string(7) "success" ["password"]=> string(0) "" } 0 Quote Link to comment Share on other sites More sharing options...
deadsik Posted March 27 Author Share Posted March 27 I checked with different types of authentication, if something is really wrong, it returns a response that the client was not found. 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted March 27 Share Posted March 27 Check the version history for the API method. It's deprecated since version 8. 0 Quote Link to comment Share on other sites More sharing options...
leemahoney3 Posted March 28 Share Posted March 28 Yeah since WHMCS 8 clients no longer have passwords, users do. Hence the empty string as the password field in tblclients is blank. There is no API method to get a users password. Your best using the ValidateLogin API method if you are trying to compare a password to login elsewhere. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.