user.updateprofile

Description

object user.updateprofile(object parameters)

This method allows to update the currently logged in user.

This method is deprecated and will be removed in the future. Please use user.update instead.

Parameters

(object/array) User properties to be updated.

The userid property must not be defined. Only the passed properties will be updated, all others will remain unchanged.

Additionally to the standard user properties, the method accepts the following parameters.

Parameter Type Description
passwd string User's password.
usrgrps array User groups to replace existing user groups. The user groups must have the usrgrpid property defined.

Return values

(object) Returns an object containing the ID of the updated user under the userids property.

Examples

Renaming the current user

Rename the current user to John Doe.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "user.updateprofile",
  4. "params": {
  5. "name": "John",
  6. "lastname": "Doe"
  7. },
  8. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  9. "id": 1
  10. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "userids": [
  5. "1"
  6. ]
  7. },
  8. "id": 1
  9. }

See also

Source

CUser::update() in frontends/php/include/classes/api/services/CUser.php.