Versions Compared

Key

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

...


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/password
Content typeapplication/json
Body


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


Response

"true"


 Error Cases :

Internal server error, encountered server error while performing operations
code
Applies to
Status Message
200All resources
HTTP Response Code
Description
200Password has been updated successfully
400All requests500All requests
  1. Invalid 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
  1. - 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.