How to change password using API?

Hello guys,

I want to update my password using the API, but it doesn’t work.
The following is the message I sent. It seems that homePageId and userName are required.
"homePageId=icondashboard.view&userName=Beatles&newPassword=SGVsbG9Xb3JsZA%3D%3D&retypeNewPassword=SGVsbG9Xb3JsZA%3D%3D”
Failed to edit user: {“error”:422,“message”:“The library quota must be an integer.”,“property”:“libraryQuota”,“help”:null}

An error occurred, and it seems that libraryQuota must also be specified, so I changed the data as follows and sent it.

“homePageId=icondashboard.view&userName=Beatles&libraryQuota=4096&newPassword=SGVsbG9Xb3JsZA%3D%3D&retypeNewPassword=SGVsbG9Xb3JsZA%3D%3D"

The result is a 500 error.
Failed to edit user: {“success”:false,“error”:500,“message”:“An unexpected error occurred. Please contact support.”}

What data should I use to call the API?

API user is super admin user.

CMS-Version 4.2.3

Yes, they are required fields.

according to the documentation, libraryQuota is an optional field. However, It seems that the API expects an integer value for it even when it’s not required (we’ll raise this to our dev team to have a look)

Please make sure all of these following fields are included in your request, even if you’re only intending to update the password. This should resolve the errors you were seeing earlier.

{
  "userName": "john",
  "newPassword": "password",
  "retypeNewPassword": "password",
  "userTypeId": 3,
  "libraryQuota": 0,
  "homeFolderId": 1,
  "homePageId": "icondashboard.view"
}

1 Like

Hi, Israt-san,

I understand.Thanks to you, I was able to update password using API.
Thank you very much.

MarkMiura

1 Like