Update User Role

Last Updated on : 2023-06-15 05:02:55

Update the role of a specified user. The new settings will overwrite the previous settings.

API address

PUT: /v1.0/iot-02/users/{uid}/roles

Request parameter

Parameter nameTypeINRequiredDescription
uidStringuritrueThe user ID.

Description of body

Parameter nameTypeINRequiredDescription
role_codesList trueThe list of role codes.

Return parameter

Parameter nameTypeDescription
resultBooleanIndicates whether the operation is successful. Valid values:
  • true: success.
  • false: failure.

Request example

PUT: /v1.0/iot-02/users/123456789012345****/roles
{
  "role_codes": [
    "roleCode****"
  ]
}

Return example

true

Error code

For more information, see error code.