Query User List

Last Updated on : 2023-10-09 08:08:34download

Based on the permission ID, query the list of users that are linked with the specified permission.

API address

GET: /v2.0/cloud/iam/user/permission/{permission_id}

Request parameter

Parameter nameTypeINRequiredDescription
permission_idLonguritrueThe ID of the specified permission.
last_row_keyLongqueryfalseThe starting ID of the query.
page_sizeIntegerqueryfalseThe number of items returned on each page.

Return parameter

Parameter nameTypeDescription
successBooleanIndicates whether the operation is successful. Valid values:
  • true: The operation succeeded.
  • false: The operation failed.
error_codeStringThe error code. For more information, see the error codes.
error_msgStringThe message that is returned if the request fails. It is empty if the request is successful.
resultQueryUserListByPermissionResThe returned result.

Description of result

Parameter nameTypeDescription
permission_idLongThe ID of the specified permission.
permission_nameStringThe name of the specified permission.
permission_descStringThe description of the specified permission.
user_idsListThe list of user IDs (UIDs).
last_row_keyLongThe starting ID of the query.
page_sizeIntegerThe number of items returned on each page.
totalIntegerThe total number of returned entries.

Description of user_ids

Parameter nameTypeDescription
user_idStringThe user ID.
gmt_createLongThe creation time.

Request example

GET: /v2.0/cloud/iam/user/permission/123?last_row_key=0&page_size=100

Return example

{
    "tid": "195bceee56b411ee801ef25dabf95fef",
    "result": {
        "last_row_key": 181044,
        "user_ids": [
            {
                "gmt_create": 1695104201,
                "user_id": "uid123"
            }
        ],
        "permission_id": 232371810,
        "permission_name": "Permission name",
        "total": 15,
        "permission_desc": "Description",
        "page_size": 10
    },
    "t": 1695104201504,
    "success": true
}

Error code

For more information, see error code.