UpdateSysUser
This API can be used to update the password and status of a system user.
The settings can be found on the AhsayCBS web console at:
- System Settings > Basic > Administrative Access
Starting with AhsayCBS v8.3.4.0 affecting all APIs, if AhsayCBS Administrative Access feature is enabled, users may see the error message:
“Your password has expired and must be changed. Please update in web console or by UpdateSysUser API”
This message may appear if a system user’s password is expired when calling any API except UpdateSysUser.do. AddSysUser.do and UpdateSysUser.do may see error messages regarding password complexity when complexity settings are enabled.
The settings can be found on the AhsayCBS web console at: System Settings > Basic > Administrative Access > Authentication > Password.
URL
https://CBS.EXAMPLE.COM/obs/api/json/UpdateSysUser.do
Available Since Version: 9.1
Parameters
Key | Type | Description |
---|---|---|
SysUser | String | Username of an AhsayCBS System User with Admin, API or Read-Only API role. |
SysPwd | String | Password matching SysUser. |
LoginName | String | Login name of the system user. |
Password | String | Password in plaintext or hashed password. If passing hashed, include PasswordHashed key. Use ListSystemUsers.do to lookup HashedPwd. |
Status | String | Can either be "SUSPENDED" or "ENABLED". |
PasswordHashed | Boolean |
An indicator for account’s input password if hashed or not. Default “false” if NOT in request. If PasswordHashed is set to false, the Password will be hashed and stored. If set as true, Password will be stores as-is. If PasswordHashed is set to true and not using a hashed password, then users will not be able to login to the system. Hash Algorithm: Plaintext input > encode Hash algorithm SHA-256 > output Hex bytes > encode Hex-Base64 > Hashed text output |
Role | String | Role of the system account. The value can be set to one of the following: ADMIN, READ_ONLY_ADMIN, RESELLER and API_ONLY. |
IsShowRebrandingPages | Boolean | Corresponding to the three checkboxes on AhsayCBS UI when edit a sub-admin applies only if “Role” is set to RESELLER. |
IsSendConsolidatedReport | Boolean | Corresponding to the three checkboxes on AhsayCBS UI when edit a sub-admin applies only if “Role” is set to RESELLER. |
IsFreeTrialOfferAllowed | Boolean | True = Allow sub-admin accounts to configure Free Trial options and allow to set users to Trial user type. Corresponding to the three checkboxes on AhsayCBS UI when edit a sub-admin applies only if “Role” is set to RESELLER. |
Return Values
Key | Type | Description |
---|---|---|
Status | String | "OK" or "Error" |
Message | String | Error message, it only appears if status displays "Error". |
ExptType | String | The type of exception, will only be displayed if the status is "Error". |
Examples
Example 1
INPUT
{
"SysUser":"sample",
"SysPwd":"sample",
"LoginName":"admin123",
"Password":"changepassword",
"PasswordHashed":"false"
}
OUTPUT
{
"Status":"OK"
}
Example 2: Missing the LoginName parameter
INPUT
{
"SysUser":"sample",
"SysPwd":"sample",
"Password":"changepassword"
}
OUTPUT
{
"Status":"Error",
"Message":"[Error] Parameter LoginName is null/empty!",
"ExptType":"com.ahsay.obs.core.dbs.DbsException"
}
Example 3
INPUT
{
"SysUser":"sample",
"SysPwd":"sample",
"LoginName":"admin123",
"Password":"changepassword",
"Status":"ENABLED"
}
OUTPUT
{
"Status":"OK"
}
Example 4
INPUT
{
"SysUser":"sample",
"SysPwd":"sample",
"LoginName":"admin123",
"Password":"changepassword",
"Status":"LOCKED"
}
OUTPUT
{
"Status":"Error",
"Message":"Invalid value. ‘Status’ must be ‘ENABLED’ or ‘SUSPENDED’",
"ExptType":"com.ahsay.obs.core.dbs.DbsException"
}
Example 5
INPUT
{
"SysUser":"sample",
"SysPwd":"sample",
"LoginName":"admin123",
"Password":"changepassword",
"Status":0
}
OUTPUT
{
"Status":"Error",
"Message":"JSONObject\”Status\”\not a string",
"ExptType":"org.json.JONException"
}
Example 6
INPUT
{
"SysUser":"sample",
"SysPwd":"sample"
}
OUTPUT
{
"Status":"Error",
"Message":"[Error] Parameter LoginName is null/empty!",
"ExptType":"com.ahsay.obs.core.dbs.DbsException"
}