Add User Roles

Last Updated on : 2023-07-06 09:13:40download

Add multiple roles for a specified user.

API address

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

Request parameter

Parameter nameTypeINRequiredDescription
uidStringuritrueThe user ID.

Description of body

Parameter nameTypeINRequiredDescription
roleCodesList trueThe identifier of a specified role.

Return parameter

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

Request example

POST: /v1.0/iot-02/users/123/roles
{
  "permission_code": "permissionCodendhs"
}

Return example

{
    "tid": "916a3b68987e11ec881ac2511f4137af",
    "result": true,
    "t": 1646042991513,
    "success": true
}

Error code

For more information, see error code.