Versions Compared

Key

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

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

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

Below are the attributes which

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
identifier
oldPassword

Old

Password

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
Password that
user
wants to set
password


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

Use this URL to change the password in caTissue application.

Result:

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

Below is the an example of the change password :

 

API request/resposne.

Method
URL
MethodPUT
URL
catissuecore
/openspecimen/rest/ng/users/
{userId}/password?type=changeRequest
password
Content typeapplication/json
json{"
Body


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


Response

"
success
true"


 Error Cases :

 
code
Applies to
Status Message
200All resources
HTTP Response Code
Description
200Password has been updated successfully
400
All requests
  1. Invalid parameters
, e.g  blank Old Password, blank New Password etc.401All requestsAuthorization failed, User doesn’t have Authority404All requestsUser not found, User with given details not present in the system500All requestsInternal server error, Encountered server error while performing operations

 

 

 

  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.