A MoogDb v2 method that updates an existing user, by passing an object containing user information.
Back to MoogDb V2 API Method Reference.
Method updateUser
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| Object | Yes | Object containing the user details. |
The user object userObj
contains the following information:
Name | Type | Required | Description |
---|---|---|---|
| String | No, if you use | Username of the user to be updated. |
| Number | No, if you use | User ID of the user to be updated. |
| String | No | New user password, only valid for DB realm. |
| Boolean | No | Set to |
| String | No | User's email address. |
| String | No | User's full name. |
| JSON Array | No | List of either the role IDs or the role names. For example, |
| String or Number | No | User's primary group name or primary group ID. |
| String or Number | No | User's department ID or department name. |
| String | No | User's timezone. |
| String | No | User's phone number. |
| Number | No | Number of minutes after which the user's session expires. Default is the system default. |
| JSON Array | No | A list with the user competencies. Each competency should have have name or cid and ranking. For example: [
{"name":"SunOS", "ranking": 40},
{"name":"SAP", "ranking": 50},
{"name":"EMC", "ranking": 60}
] |
| JSON Array of Numbers or Strings | No | List of the user's team names or team IDs. |
Method updateUser
returns the following response:
The following examples demonstrate typical use of method updateUser
:
Example request to update a number of fields in user ID 5:
{
"uid": 5,
"fullname": "Phil Customer",
"competencies": [
{
"name": "SunOS",
"ranking": 40
},
{
"name": "SAP",
"ranking": 50
},
{
"name": "EMC",
"ranking": 60
}],
"roles": ["Super User"],
"department": 3,
"active": true,
"email": "phil@example.com",
"timezone": "(GMT 00:00) Europe/Jersey - Greenwich Mean Time",
"teams": [1, 2, 4],
"joined": 12345678,
"contact_num": "0965412345"
}