Versions Compared

Key

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

Change Password :

This API is useful when user wants to change the password.

Api :

Method
URL
PUTcatissuecore

openspecimen/rest/ng/users/password

Use this API to change the user passwords.

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

/{userId}

/password

?type=changeRequestapplication/jsonjson{"oldPassword":"Login123","newPassword":"Login1234"}

Response

"success"

Set Password :

This API is useful when user redirects through forgot password link or new user sets the password through email.

Api :

 

Method
URL
PUTcatissuecore

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


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


Response

"
success
true"


 Error Cases :

code
Applies to
Status Message
200All resources 201All POST/PUT requestsResource created/
HTTP Response Code
Description
200Password has been updated successfully
400
All requests
  1. Invalid parameters
, this will also includes application specific error messages401All requestsAuthorization failed404All requestsResource not found, also includes specified resource id/name/title500All requestsInternal server error
  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.