User Update¶
To update an existing user, call the URI http(s)://<qie_server>:<management_api_port>/user/update with the following payload:
{
"userId": "<desired user id>",
"enabled": true | false,
"fullName": "<desired full name>",
"email": "<desired email address>",
"phone": "<desired phone>",
"description": "<desired description>",
"password": "<desired password>",
"tempPassword": true | false,
"emailPassword": true | false,
"daysPasswordValid": "<desired number of days>" | "None",
"minPasswordStrength": "NONE" | "WEAK" | "MEDIUM" | "STRONG",
"lockTimeout": "<desired lock timeout>",
"logoutTimeout": "<desired logout timeout>",
"administrator": true | false,
"formatOutput": true | false,
"zonePermissions": [
{
"zoneName": "<desired zone name>",
"remove": true | false,
"error": true | false,
"view": true | false,
"manage": true | false,
"edit": true | false,
"alert": true | false
},
….
]
}
Base JSON Payload Definition
| Node | Description |
|---|---|
| userId | REQUIRED: The user id to update. Updating the default 'admin' user or the management API user used to make this request is not allowed. |
| enabled | REQUIRED: True to enable user (default=True). False to disable user. |
| fullName | REQUIRED: The full name for this user. |
| The email address for this user. | |
| phone | The phone for this user. |
| description | A description for this user. |
| password | A password for this user. |
| tempPassword | True to make the password a temporary password which forces the user to change the password the next time they log into the system (default=false). |
| daysPasswordValid | Specifying a value greater than 0 forces QIE users to change their password after the number of days specified. 0=always valid/never expires. The default is set in the System Administration>System Configuration. |
| minPasswordStrength | The minimum strength required for this user's password. One of the following values (NONE | WEAK | MEDIUM | STRONG). The default is set in the System Administration>System Configuration. If the System Administration>System Configuration is set to Custom this is ignored. |
| lockTimeout | The number of seconds before the screen locks with no activity. The default is set in the System Administration>System Configuration. |
| logoutTimeout | The number of seconds before the user is logged out with no activity. The default is set in the System Administration>System Configuration. |
| administrator | True means this user has System Administrator permissions, has full access to all zones and all system administration settings. System Administrators require at least medium strength password (default=false). When administrator=true only the alert permission can be set. The error, view, manage, and edit permissions, if passed, causes the request to fail. |
| formatOutput | True if the response JSON should be formatted as human readable (default=false). |
| zonePermissions | An array of zone permissions to manage a user's access to zones that exist in the system. If no user permissions are included in the payload definition, the user is created with no access to any zone. |
Zone Permission JSON Object Definition
| Node | Description |
|---|---|
| zoneName | REQUIRED: Name of zone. |
| remove | True to remove this zone permission from user (default = false). |
| error | True if user is only allowed to manage errors for the specified zone (default = false). Cannot be used with the global zone (Global Settings). Cannot be used when administrator=true. |
| view | True if user is allowed read-only access to the zone and its related resources. The user can view all zone related resources, including channel status information but they cannot manage (start, stop, pause) or edit any of the resources (default = false). Cannot be used with the global zone (Global Settings). Cannot be used when administrator=true. |
| manage | True if user is allowed all view privileges, plus the ability to start, stop or pause enabled channels (default = false). Cannot be used with the global zone (Global Settings). Cannot be used when administrator=true. |
| edit | True if user is allowed all view and manage privileges, plus the ability to add, edit and delete zone related resources (default = false). Can be used on any zone including the global zone (Global Settings) when administrator=false. Cannot be used on any zone when administrator=true |
| alert | True if user with a valid email address should receive email alerts whenever warning or error conditions occur on any channels associated with the zone (default = false). Email alerts can only be sent out if the SMTP server is configured in System Administration->System Configuration. This permission can be set on all zones and when administrator is true or false. |
The following response is received if the userId exists and it was successfully updated:
HTTP Status: 200
| Node | Description |
|---|---|
| message | This message indicates whether the user was updated. |
If there is an error updating the user or adjusting user permissions, then the following response is received:
HTTP Status: 400
Example curl command:
curl -H "apiToken:abc123" --request POST http://qieserver:9999/user/update -d '{"userid": "myUserid","enabled":true,"fullName":"myFullName","email":"myEmail","phone":"myPhone","description":"myDescription","newPassword":"myPassword","tempPassword":true,"emailPassword":false,"daysPasswordValid":0,"minPasswordStrength":"STRONG","lockTimeout":900,"logoutTimeout":3600,"administrator":false,"formatOutput":true,"zonePermissions":[{"zoneName":"myZoneName","remove":false,"error":false,"view":true,"manage":true,"edit":true,"alert":true}]}'
curl -H "apiToken:abc123" --request POST http://qieserver:9999/user/update -d "{\"userid\": \"myUserid\",\"enabled\":true,\"fullName\":\"myFullName\",\"email\":\"myEmail\",\"phone\":\"myPhone\",\"description\":\"myDescription\",\"newPassword\":\"myPassword\",\"tempPassword\":true,\"emailPassword\":false,\"daysPasswordValid\":0,\"minPasswordStrength\":\"STRONG\",\"lockTimeout\":900,\"logoutTimeout\":3600,\"administrator\":false,\"formatOutput\":true,\"zonePermissions\":[{\"zoneName\":\"myZoneName\",\"remove\":false,\"error\":false,\"view\":true,\"manage\":true,\"edit\":true,\"alert\":true}]}"
curl -H @{"apiToken"="abc123"} -Method POST http://qieserver:9999/user/update -Body '{"userid": "myUserid","enabled":true,"fullName":"myFullName","email":"myEmail","phone":"myPhone","description":"myDescription","newPassword":"myPassword","tempPassword":true,"emailPassword":false,"daysPasswordValid":0,"minPasswordStrength":"STRONG","lockTimeout":900,"logoutTimeout":3600,"administrator":false,"formatOutput":true,"zonePermissions":[{"zoneName":"myZoneName","remove":false,"error":false,"view":true,"manage":true,"edit":true,"alert":true}]}' | Select-Object -Expand RawContent
Use with caution
Deleting a user is permanent. Once deleted, the user can only be restored from a database backup. Use this command carefully.
This option requires the Management API to be configured with a secure connection with the Manage Users option selected. See the System Administration->System Configuration->Management API dialog.