Skip to main content

Reset Person Passwords

To utilize the API for performing operations or retrieving data required by your application, initiate a POST request to the relevant endpoint. The following example illustrates how to make an API call to reset a person's password:

Endpoint

https://<YourEmpowerIDServer>/api/services/v1/PasswordPolicy/ResetPassword

Headers

KeyValue
X-EmpowerID-API-KeyThe API key for the OAuth application you registered in EmpowerID.
AuthorizationThe OAuth token of the person making the API call.
Content-Typeapplication/json

Request Data

Request data is sent to the API in JSON format. The sample data in the below request represents the key/value pairs required for resetting a person’s password.

{"PersonID":"123456", Password":"Newp@$$w0rd","UnlockAccounts":false,"MustChangePasswordOnNextLogin":false}
Request ParameterTypeRequired / OptionalDescription
PersonIDIntegerRequiredPerson ID of the target person
PasswordStringRequiredNew password
UnlockAccountsBooleanRequiredSpecified whether to unlock the person’s accounts
MustChangePasswordOnNextLoginBooleanRequiredSpecifies whether the person must change their password the next time they log in to the system

Code Examples

cURL

info

Be sure to use double quotes unless you are making the request from a non-Windows OS.

Request

curl --location --request POST 'https://Your_Web_Server/api/services/v1/PasswordPolicy/ResetPassword' \
--header 'Content-Type: application/json' \
--data-raw '{
"Password": "<string>",
"PersonID": "<integer>",
"UnlockAccounts": "<boolean>",
"MustChangePasswordOnNextLogin": "<boolean>"
}'

C#

var client = new RestClient("https://Your_Web_Server/api/services/v1/PasswordPolicy/ResetPassword");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"Password\": \"<string>\",\n \"PersonID\": \"<integer>\",\n
\"UnlockAccounts\": \"<boolean>\",\n \"MustChangePasswordOnNextLogin": \"<boolean>" }", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Response

If the request is successful, you should receive a JSON response that looks similar to the following:

{
"Success": true,
"Message": "EmpowerID\\<Person Login Value> Password reset successfully",
"Exception": null
}