Versions Compared

Key

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

1) Change Password :

This API is useful when user wants openspecimen/rest/ng/users/password

Use this API to change the passworduser passwords.

Method
URL
DELETEcatissuecore/rest/ng/users/{userId}/password?type=change
Request{"oldPassword":"Login123","newPassword":"Login1234"}

Response

"success"

 

2) Set Password :
This API is useful when user redirect through forgot password link or new user sets the password through email.
Method
URL
DELETEcatissuecore

The following table lists the attributes that need to be sent in the API request body.


Parameter
Details
userIdUser identifier
oldPassword

Old password of the user.

This is not mandatory if

a) the super-admin user is invoking this API and

b) the super-admin user is not changing his/her own password!

newPasswordNew user password


http[s]://<host>:<port>/openspecimen/rest/ng/users/password

Use this URL to change the user password

Below is an example of the change password API request/resposne.

Method
URL
MethodPUT
URL/openspecimen/rest/ng/users/
{userId}/password?token={token}Request{
password
Content typeapplication/json
Body


Code Block
languagejs
themeEclipse
linenumberstrue
{
    "userId": 134,
    "oldPassword": "
Login123
Login!@3",
    "newPassword": "
Login1234
Admin!@3"
}


Response

"
success"
true"


 Error Cases :

HTTP Response Code
Description
200Password has been updated successfully
400
  1. Invalid parameters - empty new password, userId not specified
  2. User doesn't have rights to change the password
  3. User (userId) does not exist
  4. Input old password does not match etc
500Unknown, unhandled system errors.