Users APIs

In Bigin, the user is the one who is allowed to access and manage the Bigin records. These users can be defined under various profiles and categories such as Administrators, Standard, etc,.

Using the Users APIs, you can retrieve the basic information of your available Bigin users. Use the type parameter to get the required list of users. For example, you can set the param type as AdminUsers, to get the list of Bigin users with Administrative profile. The detailed explanation of the Users API and the examples are shown below:

Get Users

Purpose

To retrieve the users' data specified in the API request. You can specify the type of users that needs to be retrieved using the Users API. For example, use type=AllUsers, to get the list of all the Bigin users available.

Request Details

Request URL

https://www.zohoapis.com/bigin/v1/users
 

Scope

scope=ZohoBigin.users.{operation_type}

Possible operation types

ALL - Full access to users
READ - Get user data

Parameters
  • typestring, optional

    Specify the type of the users you want to retrieve.

    • AllUsers - To list all users in your organization (both active and inactive users).
    • ActiveUsers - To get the list of all the Active Users.
    • DeactiveUsers - To get the list of all the users who were deactivated.
    • ConfirmedUsers - To get the list of all the confirmed users.
    • NotConfirmedUsers - To get the list of all the non-confirmed users.
    • DeletedUsers - To get the list of deleted users.
    • ActiveConfirmedUsers - To get the list of active users who are also confirmed.
    • AdminUsers - To get the list of admin users.
    • ActiveConfirmedAdmins - To get the list of active users with the administrative privileges and are also confirmed.
    • CurrentUser - To get the current Bigin user.
  • pageinteger

    To get the list of user records from the respective pages. Default value is 1.

  • per_pageinteger

    To set the number of user records to be retrieved per page. Default value is 200.

Note
  • The page and per_page parameter are used to fetch user records according to their position in the Bigin. Let us assume that the user has to fetch 400 user records. The maximum number of user records that one can get for an API call is 200. So, for the user records above the 200th position, they cannot be fetched. By using the page (1 and 2) and per_page (200) parameter, the user can fetch all 400 user records using 2 API calls.

Sample Request

Copiedcurl "https://www.zohoapis.com/bigin/v1/users?type=AllUsers"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
CopiedZCRMRestClient client = ZCRMRestClient.getInstance();
        BulkAPIResponse response = client.getOrganizationInstance().getAllUsers();
        List<ZCRMUser> users = (List<ZCRMUser>) response.getData();
Copieddef get_users(self, user_type):
        try:
            if user_type == 'all':
                resp = ZCRMOrganization.get_instance().get_all_users()
            elif user_type == 'DeactiveUsers':
                resp = ZCRMOrganization.get_instance().get_all_deactive_users()
            elif user_type == 'ActiveUsers':
                resp = ZCRMOrganization.get_instance().get_all_active_users()
            elif user_type == 'ConfirmedUsers':
                resp = ZCRMOrganization.get_instance().get_all_confirmed_users()
            elif user_type == 'NotConfirmedUsers':
                resp = ZCRMOrganization.get_instance().get_all_not_confirmed_users()
            elif user_type == 'DeletedUsers':
                resp = ZCRMOrganization.get_instance().get_all_deleted_users()
            elif user_type == 'ActiveConfirmedUsers':
                resp = ZCRMOrganization.get_instance().get_all_active_confirmed_users()
            elif user_type == 'AdminUsers':
                resp = ZCRMOrganization.get_instance().get_all_admin_users()
            elif user_type == 'ActiveConfirmedAdmins':
                resp = ZCRMOrganization.get_instance().get_all_active_confirmed_admin_users()
            elif user_type == 'CurrentUser':
                resp = ZCRMOrganization.get_instance().get_current_user()
            print (resp.status_code)
            if resp.status_code != 200:
                return
            users = resp.data
            for user in users:
                print ("\n\n")
                print (user.id)
                print (user.name)
                print (user.signature)
                print (user.country)
                crm_role = user.role
                if crm_role is not None:
                    print (crm_role.name)
                    print (crm_role.id)
                customize_info = user.customize_info
                if customize_info is not None:
                    print (customize_info.notes_desc)
                    print (customize_info.is_to_show_right_panel)
                    print (customize_info.is_bc_view)
                    print (customize_info.is_to_show_home)
                    print (customize_info.is_to_show_detail_view)
                    print (customize_info.unpin_recent_item)
                print (user.city)
                print (user.name_format)
                print (user.language)
                print (user.locale)
                print (user.is_personal_account)
                print (user.default_tab_group)
                print (user.street)
                print (user.alias)
                user_theme = user.theme
                if user_theme is not None:
                    print (user_theme.normal_tab_font_color)
                    print (user_theme.normal_tab_background)
                    print (user_theme.selected_tab_font_color)
                    print (user_theme.selected_tab_background)
                print (user.state)
                print (user.country_locale)
                print (user.fax)
                print (user.first_name)
                print (user.email)
                print (user.zip)
                print (user.decimal_separator)
                print (user.website)
                print (user.time_format)
                crm_profile = user.profile
                if crm_profile is not None:
                    print (crm_profile.id)
                    print (crm_profile.name)
                print (user.mobile)
                print (user.last_name)
                print (user.time_zone)
                print (user.zuid)
                print (user.is_confirm)
                print (user.full_name)
                print (user.phone)
                print (user.dob)
                print (user.date_format)
                print (user.status)
        except ZCRMException as ex:
            print (ex.status_code)
            print (ex.error_message)
            print (ex.error_code)
            print (ex.error_details)
            print (ex.error_content)
Copiedtry{
          $bulkAPIResponse=ZCRMOrganization::getInstance()->getAllUsers();
          $users=$bulkAPIResponse->getData();
          foreach($users as $userInstance)
          {
          echo $userInstance->getCountry();
          $roleInstance=$userInstance->getRole();
          echo $roleInstance->getId();
          echo $roleInstance->getName();
          $customizeInstance=$userInstance->getCustomizeInfo();
          if($customizeInstance!=null)
          {
          echo $customizeInstance->getNotesDesc();
          echo $customizeInstance->getUnpinRecentItem();
          echo $customizeInstance->isToShowRightPanel();
          echo $customizeInstance->isBcView();
          echo $customizeInstance->isToShowHome();
          echo $customizeInstance->isToShowDetailView();
          }
          echo $userInstance->getCity();
          echo $userInstance->getSignature();
          echo $userInstance->getNameFormat();
          echo $userInstance->getLanguage();
          echo $userInstance->getLocale();
          echo $userInstance->isPersonalAccount();
          echo $userInstance->getDefaultTabGroup();
          echo $userInstance->getAlias();
          echo $userInstance->getStreet();
          $themeInstance=$userInstance->getTheme();
          if($themeInstance!=null)
          {
          echo $themeInstance->getNormalTabFontColor();
          echo $themeInstance->getNormalTabBackground();
          echo $themeInstance->getSelectedTabFontColor();
          echo $themeInstance->getSelectedTabBackground();
          }
          echo $userInstance->getState();
          echo $userInstance->getCountryLocale();
          echo $userInstance->getFax();
          echo $userInstance->getFirstName();
          echo $userInstance->getEmail();
          echo $userInstance->getZip();
          echo $userInstance->getDecimalSeparator();
          echo $userInstance->getWebsite();
          echo $userInstance->getTimeFormat();
          $profile= $userInstance->getProfile();
          echo $profile->getId();
          echo $profile->getName();
          echo $userInstance->getMobile();
          echo $userInstance->getLastName();
          echo $userInstance->getTimeZone();
          echo $userInstance->getZuid();
          echo $userInstance->isConfirm();
          echo $userInstance->getFullName();
          echo $userInstance->getPhone();
          echo $userInstance->getDob();
          echo $userInstance->getDateFormat();
          echo $userInstance->getStatus();
          }
          }
          catch(ZCRMException $e)
          {
          echo $e->getMessage();
          echo $e->getExceptionCode();
          echo $e->getCode();
          }
CopiedZCRMRestClient restClient = ZCRMRestClient.GetInstance();
BulkAPIResponse<ZCRMUser> response = restClient.GetOrganizationInstance().GetAllUsers();
List<ZCRMUser> allUsers = response.BulkData; //response - list of ZCRMUser instances
Copiedresponse = invokeurl
[
	url: "https://www.zohoapis.com/crm/v2/users"
	type: GET
	connection:"crm_oauth_connection"
];
info response;

 

Sample Response

Copied{
    "users": [
        {
            "country": null,
            "role": {
                "name": "CEO",
                "id": "87157000000031151"
            },
            "signature": "",
            "city": null,
            "name_format": "Salutation,First Name,Last Name",
            "language": "en_US",
            "locale": "en_US",
            "microsoft": false,
            "personal_account": false,
            "Modified_By": {
                "name": "Patricia Boyle",
                "id": "87157000000116013"
            },
            "street": null,
            "alias": null,
            "id": "87157000000116013",
            "state": null,
            "fax": null,
            "country_locale": "US",
            "first_name": "Patricia",
            "email": "zylker.bigin@gmail.com",
            "decimal_separator": "en_IN",
            "zip": null,
            "created_time": "2020-01-10T14:33:16+05:30",
            "Modified_Time": "2020-06-12T09:33:11+05:30",
            "website": null,
            "time_format": "hh:mm a",
            "offset": 19800000,
            "profile": {
                "name": "Administrator",
                "id": "87157000000031157"
            },
            "mobile": null,
            "last_name": "Boyle",
            "time_zone": "Asia/Kolkata",
            "created_by": {
                "name": "Patricia Boyle",
                "id": "87157000000116013"
            },
            "zuid": "60003390177",
            "confirm": true,
            "full_name": "Patricia Boyle",
            "phone": null,
            "dob": null,
            "date_format": "MM/dd/yyyy",
            "status": "active"
        },
        {
            "country": null,
            "role": {
                "name": "CEO",
                "id": "87157000000031151"
            },
            "city": null,
            "language": "en_US",
            "locale": "en_US",
            "microsoft": false,
            "Modified_By": {
                "name": "Patricia Boyle",
                "id": "87157000000116013"
            },
            "street": null,
            "alias": null,
            "id": "87157000000122024",
            "state": null,
            "fax": null,
            "country_locale": "US",
            "first_name": "Patrick",
            "email": "patrick.jane1927@gmail.com",
            "zip": null,
            "created_time": "2020-01-21T16:31:57+05:30",
            "Modified_Time": "2020-01-25T09:03:17+05:30",
            "website": null,
            "time_format": "hh:mm a",
            "offset": 19800000,
            "profile": {
                "name": "Administrator",
                "id": "87157000000031157"
            },
            "mobile": null,
            "last_name": "Jane",
            "time_zone": "Asia/Kolkata",
            "created_by": {
                "name": "Patricia Boyle",
                "id": "87157000000116013"
            },
            "zuid": "60003492425",
            "confirm": true,
            "full_name": "Patrick Jane",
            "phone": null,
            "dob": null,
            "date_format": "MM/dd/yyyy",
            "status": "disabled"
        },
        {
            "country": null,
            "role": {
                "name": "CEO",
                "id": "87157000000031151"
            },
            "city": null,
            "language": "en_US",
            "locale": "en_US",
            "microsoft": false,
            "Modified_By": {
                "name": "Patricia Boyle",
                "id": "87157000000116013"
            },
            "street": null,
            "alias": null,
            "id": "87157000000122037",
            "state": null,
            "fax": null,
            "country_locale": "US",
            "first_name": "Rachel",
            "email": "arunkumsrvtest10@gmail.com",
            "zip": null,
            "created_time": "2020-01-21T16:37:57+05:30",
            "Modified_Time": "2020-01-25T09:03:17+05:30",
            "website": null,
            "time_format": "hh:mm a",
            "offset": 19800000,
            "profile": {
                "name": "Administrator",
                "id": "87157000000031157"
            },
            "mobile": null,
            "last_name": "Stone",
            "time_zone": "Asia/Kolkata",
            "created_by": {
                "name": "Patricia Boyle",
                "id": "87157000000116013"
            },
            "zuid": null,
            "confirm": false,
            "full_name": "Rachel Stone",
            "phone": null,
            "dob": null,
            "date_format": "MM/dd/yyyy",
            "status": "deleted"
        },
        {
            "country": null,
            "role": {
                "name": "CEO",
                "id": "87157000000031151"
            },
            "city": null,
            "language": "en_US",
            "locale": "en_US",
            "microsoft": false,
            "Modified_By": {
                "name": "Patricia Boyle",
                "id": "87157000000116013"
            },
            "street": null,
            "alias": null,
            "id": "87157000000122047",
            "state": null,
            "fax": null,
            "country_locale": "US",
            "first_name": null,
            "email": "arunkumsrvtest10@gmail.com",
            "zip": null,
            "created_time": "2020-01-21T16:52:01+05:30",
            "Modified_Time": "2020-01-25T09:03:17+05:30",
            "website": null,
            "time_format": "hh:mm a",
            "offset": 19800000,
            "profile": {
                "name": "Standard",
                "id": "87157000000031160"
            },
            "mobile": null,
            "last_name": "Rachel",
            "time_zone": "Asia/Kolkata",
            "created_by": {
                "name": "Patricia Boyle",
                "id": "87157000000116013"
            },
            "zuid": null,
            "confirm": false,
            "full_name": "Rachel",
            "phone": null,
            "dob": null,
            "date_format": "MM/dd/yyyy",
            "status": "deleted"
        },
        {
            "country": null,
            "role": {
                "name": "Manager",
                "id": "87157000000031154"
            },
            "city": null,
            "language": "en_US",
            "locale": "en_US",
            "microsoft": false,
            "Modified_By": {
                "name": "Patricia Boyle",
                "id": "87157000000116013"
            },
            "street": null,
            "alias": null,
            "id": "87157000000249023",
            "state": null,
            "fax": null,
            "country_locale": "US",
            "first_name": "Tresa",
            "email": "aayisha.h+bigintest@zohotest.com",
            "zip": null,
            "created_time": "2020-06-12T08:33:44+05:30",
            "Modified_Time": "2020-08-17T07:45:50+05:30",
            "website": null,
            "time_format": "hh:mm a",
            "offset": 19800000,
            "profile": {
                "name": "Standard",
                "id": "87157000000031160"
            },
            "mobile": null,
            "last_name": "Sweeley",
            "time_zone": "Asia/Kolkata",
            "created_by": {
                "name": "Patricia Boyle",
                "id": "87157000000116013"
            },
            "zuid": "60005573585",
            "confirm": true,
            "full_name": "Tresa Sweeley",
            "phone": null,
            "dob": null,
            "date_format": "MM/dd/yyyy",
            "status": "active"
        }
    ],
    "info": {
        "per_page": 200,
        "count": 5,
        "page": 1,
        "more_records": false
    }
}