techwthquestion Posted July 18, 2016 Share Posted July 18, 2016 Hello I would like to change cpanel account password using whmcs API. Can you please let me know how can I do it ? 0 Quote Link to comment Share on other sites More sharing options...
twhiting9275 Posted July 18, 2016 Share Posted July 18, 2016 The Update Client API is what you're looking for here. A brief example of this. You will need to tweak it to do what you need <?php // I store all my own API stuff outside of public_html, change yours as needed require_once("public_html/init.php"); $command = "updateclient"; //your admin username $adminuser = "adminusername"; //the affected client id $values["clientid"] = "1"; $values["status"] = "Active"; $values["password2"] = "newpassword"; $results = localAPI($command,$values,$adminuser); print_r($results); ?> 0 Quote Link to comment Share on other sites More sharing options...
twhiting9275 Posted July 18, 2016 Share Posted July 18, 2016 Sorry, I missed that you wanted control panel password. This will do that for you. <?php // I store all my own API stuff outside of public_html, change yours as needed require_once("public_html/init.php"); $command = "modulechangepw"; //your admin username $adminuser = "adminusername"; //the affected service id. Get this by going to WHMCS -> admin-> client -> view services $values["serviceid"] = "1"; $values["servicepassword"] = "newpassword"; $results = localAPI($command,$values,$adminuser); print_r($results); ?> 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.