Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

openspecimen/rest/ng/users/{userId}/password?type=change

Use this resource for change the password in the OpenSpecimen application. Use HTTP PUT method to call this API by passing the below details in JSON format.

Below are the attributes which need to be sent in the request:

 

Parameter
Details
userIdUser identifier
oldPasswordOld password of the user.
newPasswordNew password that user wants to change


http[s]:<host>:<port>/openspecimen/rest/ng/users/{userId}/password?type=change

Use this URL to change the password in openSpecimen application.


Result:

The response of this request will contains the details of the changed password.

Below is the example of the change password:

Method
URL
PUTopenspecimen/rest/ng/users/{userId}/password?type=change
Requestapplication/json
json
Code Block
languagejs
themeEclipse
linenumberstrue
{
    "userId":134,
    "oldPassword":"
Login123
Login!@3",
    "newPassword":"
Login1234
Admin!@3"
}

Response

"successtrue"


 Error Cases :

code
Applies to
Status Message
200All resourcesPassword has been updated successfully
400All requestsInvalid parameters, e.g  blank old password, blank new password etc.
401All requestsAuthorization failed, user doesn’t have authority
404All requestsUser not found, user with given details not present in the system
500All requestsInternal server error, encountered server error while performing operations