Query All Roles of a User

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

Query all roles of a single user based on the user ID.

API address

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

Request parameter

Parameter nameTypeINRequiredDescription
uidStringuritrueThe user ID.

Return parameter

Parameter nameTypeDescription
resultListThe returned result of a specified user's roles.

Description of result

Parameter nameTypeDescription
role_nameStringThe name of a specified role.
role_codeStringThe identifier of a specified role.
remarkStringThe remarks.

Request example

GET: /v1.0/iot-02/users/bsh1645068029415****/roles

Return example

{
    "tid": "520dfeab948811ec82481264f1be8bd1",
    "result": [
        {
            "role_code": "roleCodeoyKM",
            "remark": "",
            "role_name": "role1"
        },
        {
            "role_code": "roleCodehnva",
            "remark": "11",
            "role_name": "role2"
        },
        {
            "role_code": "roleCode323j",
            "remark": "",
            "role_name": "role3"
        },
        {
            "role_code": "roleCodegcnI",
            "remark": "",
            "role_name": "role3"
        }
    ],
    "t": 1645607375560,
    "success": true
}

Error code

For more information, see error code.