Get user details

Catalyst Authentication provides some methods to retrieve the details of the application users. You can obtain the user information of the current user, any user, or all users of the application.

Get Details of Current User

The get_current_user() method fetches the details of the current user accessing the application and on whose scope the function is being executed. To know more about the component instance authentication_service used below, please refer to this section.

    
copy
#Get details of user authentication_service = app.authentication() current_user = authentication_service.get_current_user()

A sample response is shown below :

    
copy
{ "zuid":"1005641433", "org_id":"1005641434", "status":"ACTIVE", "is_confirmed":false, "email_id":"amelia.burrows@zylker.com", "first_name":"Amelia", "last_name":"Burrows", "created_time":"Aug 12, 2021 12:27 PM", "role_details":{ "role_name":"App User", "role_id":"2305000000006024" }, "user_type":"App User", "user_id":"2305000000007745", "locale":"us|en|Asia/Kolkata", "time_zone":"Asia/Kolkata", "project_profiles":[ ] }

Get User Details by User ID

You can retrieve the details of a particular user by passing the userID of the user to the get_user_details() method. The response returns the details of the particular user, such as their lastname, the list of the roles the user holds, the type of the user, the orgID of the organization the user belongs to, their email address, and more.

To know more about the component instance authentication_service used below, please refer to this section.

Parameters Used

Parameter Name Data Type Definition
user_id String A Mandatory parameter. Will store the unique ID of the user whose details need to be retrieved.
    
copy
#Get details by userid authentication_service = app.authentication() user_details=authentication_service.get_user_details('12345')

A sample response is shown below :

    
copy
{ "zuid":"1005665160", "org_id":"1005665245", "status":"ACTIVE", "is_confirmed":false, "email_id":"mikerogers@zylker.com ", "first_name":"Michael", "last_name":"Rogers", "created_time":"Aug 17, 2021 04:55 PM", "role_details":{ "role_name":"App User", "role_id":"2136000000007748" }, "user_type":"App User", "user_id":"2136000000020040", "locale":"us|en|Asia/Kolkata", "time_zone":"Asia/Kolkata", "project_profiles":[ ] }

Get Details of All Users

The get_all_users() method can fetch the details of all the users of all organizations.

The response returns the following details of all the users : lastname, the list of the roles, the type of the user, email address, userID, zuid, time zone, and more.

To know more about the component instance authentication_service used below, please refer to this section.

    
copy
#Get details of all users authentication_service = app.authentication() user_details = authentication_service.get_all_users()

A sample response is shown below :

    
copy
[ { "zuid":"1005648252", "org_id":"1005648253", "status":"ACTIVE", "is_confirmed":false, "email_id":"p.boyle@zylker.com", "first_name":"Parker", "last_name":"Boyle", "created_time":"Aug 13, 2021 01:36 PM", "modified_time":"Aug 13, 2021 01:36 PM", "invited_time":"Aug 13, 2021 01:36 PM", "role_details":{ "role_name":"App User", "role_id":"2136000000007748" }, "user_type":"App User", "user_id":"2136000000007774", "locale":"us|en|Asia/Kolkata", "time_zone":"Asia/Kolkata", "project_profiles":[ ] }, { "zuid":"1005665160", "org_id":"1005665245", "status":"ACTIVE", "is_confirmed":false, "email_id":"rsmith@zylker.com ", "first_name":"Robert", "last_name":"Smith", "created_time":"Aug 17, 2021 04:55 PM", "modified_time":"Aug 17, 2021 04:55 PM", "invited_time":"Aug 17, 2021 04:55 PM", "role_details":{ "role_name":"App User", "role_id":"2136000000007748" }, "user_type":"App User", "user_id":"2136000000020040", "locale":"us|en|Asia/Kolkata", "time_zone":"Asia/Kolkata", "project_profiles":[ ] } ]

Get Details of All Users in an org

The org_id is passed as a parameter to the get_all_users() method in order to fetch the users belonging to a particular organization.

To know more about the component instance authentication_service used below, please refer to this section.

Parameters Used

Parameter Name Data Type Definition
org_id String An Optional parameter. Will store the ID of the organization whose user details need to be retrieved. If `org_id` is not specified, details of all users across all organizations will be retrieved.
    
copy
#Get details of all users authentication_service = app.authentication() user_details = authentication_service.get_all_users(1293028)

A sample response is shown below :

    
copy
[ { "zuid":"1005648252", "org_id":"1005648253", "status":"ACTIVE", "is_confirmed":false, "email_id":"roger.p@zylker.com", "first_name":"Roger", "last_name":"Parkinson", "created_time":"Aug 13, 2021 01:36 PM", "modified_time":"Aug 13, 2021 01:36 PM", "invited_time":"Aug 13, 2021 01:36 PM", "role_details":{ "role_name":"App User", "role_id":"2136000000007748" }, "user_type":"App User", "user_id":"2136000000007774", "locale":"us|en|Asia/Kolkata", "time_zone":"Asia/Kolkata", "project_profiles":[ ] } ]
Info : Refer to the SDK Scopes table to determine the required permission level for performing the above operation.

Last Updated 2025-03-28 18:24:49 +0530 +0530