Jump to content

Change account password using API


Recommended Posts

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);
?>

Link to comment
Share on other sites

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);
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated