Changes a user’s password to a temporary, system-generated value.
Use resetPassword() to request that the API change the password of a User or SelfServiceUser, and return a system-generated password string of random letters and numbers. Use setPassword() instead if you want to set the password to a specific value.
Your client application must be logged in with sufficient access rights to change the password for the specified user. For more information, see Factors that Affect Data Access.
For information on IDs, see ID Field Type.
public void resetPasswordSample() {
// Specify the user ID of the password to reset
ID idToReset = new ID("005x0000000fFLnAAM");
// Invoke the resetPasswordResult call
try {
ResetPasswordResult resetPasswordResult = binding.resetPassword(idToReset);
// Display the new server-generated password
System.out.println(resetPasswordResult.getPassword());
} catch (Exception ex) {
System.out.println("An unexpected error has occurred." + ex.getMessage());
}
}
private void resetPassword()
{
//Invoke resetPassword call and save results in ResetPasswordResult
ResetPasswordResult rpr = binding.resetPassword("userID");
// Get the generated password
System.Diagnostics.Trace.WriteLine(rpr.password);
}
| Name | Type | Description |
|---|---|---|
| userID | ID | ID of the User or SelfServiceUser whose password you want to reset. For information on IDs, see ID Field Type. |