Skip to product menu
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Payroll software with automated tax payments and filing.

Try now
New

Robotic process automation software to automate high-volume, rule-based tasks.

Try for free
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Privacy-friendly application analytics solution.

Try for free

Sales

 
CRM

Comprehensive CRM platform for customer-facing teams.

CRM
 
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
 
Forms

Build online forms for every business need.

Forms
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Sign

Digital signature app for businesses.

Sign
 
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

 
Social

All-in-one social media management software.

Social
 
Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
 
Forms

Build online forms for every business need.

Forms
 
Survey

Design surveys to reach and interact with your audience.

Survey
 
Sites

Online website builder with extensive customisation options.

Sites
 
PageSense

Website conversion optimization and personalisation platform.

PageSense
 
Backstage

End-to-end event management software.

Backstage
 
Webinar

Webinar platform for webcasting online webinars.

Webinar
 
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
 
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
 
Publish

Manage all your local business listings on a single platform.

Publish
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Sign

Digital signature app for businesses.

Sign
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
 
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
 
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce

 
Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

 
Desk

Helpdesk software to deliver great customer support.

Desk
 
Assist

Remote support and unattended remote access software.

Assist
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
FSM

End-to-end field service management platform for service businesses.

FSM
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

 
Books

Powerful accounting platform for growing businesses.

Books
 
FREE
Invoice

100% Free invoicing solution.

Invoice
 
Expense

Effortless expense reporting platform.

Expense
 
Inventory

Powerful stock management and inventory control software.

Inventory
 
Billing

End-to-end billing solution for your business.

Billing
 
Checkout

Collect payments online with custom branded pages.

Checkout
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Practice

Practice management software for accounting firms.

Practice
 
Sign

Digital signature app for businesses.

Sign
 
Commerce

eCommerce platform to manage and market your online store.

Commerce
 
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email and Collaboration

 
Mail

Secure email service for teams of all sizes.

Mail
 
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
 
Writer

Word processor for focused writing and discussions.

Writer
 
Sheet

Spreadsheet software for collaborative teams.

Sheet
 
Show

Create, edit, and share slides with a sleek presentation app.

Show
 
Notebook

Beautiful home for all your notes.

Notebook
 
Cliq

Stay in touch with teams no matter where you are.

Cliq
 
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
TeamInbox

Shared inboxes for teams.

TeamInbox
 
WorkDrive

Online file management for teams.

WorkDrive
 
Sign

Digital signature app for businesses.

Sign
 
Office Suite

Powerful collaborative work platform for teams.

Office Suite
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
 
Learn

Knowledge and learning management platform.

Learn
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
ToDo

Collaborative task management for individuals and teams.

ToDo
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
 
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

 
People

Organize, automate, and simplify your HR processes.

People
 
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
 
Expense

Effortless expense reporting platform.

Expense
 
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
Shifts

Employee scheduling and time tracking app.

Shifts
 
Sign

Digital signature app for businesses.

Sign
 
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

 
Creator

Build custom apps to simplify business processes.

Creator
 
Directory

Workforce identity and access management solution for cloud businesses.

Directory
 
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
 
Vault

Online password manager for teams.

Vault
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
Assist

Remote support and unattended remote access software.

Assist
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA

BI and Analytics

 
Analytics

Modern self-service BI and analytics platform.

Analytics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
 
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT

Project Management

 
Projects

Manage, track, and collaborate on projects with teams.

Projects
 
Sprints

Planning and tracking tool for scrum teams.

Sprints
 
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo

Developer Platforms

 
Creator

Build custom apps to simplify business processes.

Creator
 
Flow

Automate business workflows by creating smart integrations.

Flow
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
 
NEW
Apptics

Application analytics for all apps.

Apptics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep

IoT

 
NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT

Search Result

 
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
 
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
 
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
 
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
 
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
 
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
 
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho One
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Marketplace
Skip to main content

Python SDK Samples - Users Operations

Get Users
              
              
from zcrmsdk.src.com.zoho.crm.api.users import *
from zcrmsdk.src.com.zoho.crm.api.users import User as ZCRMUser
from zcrmsdk.src.com.zoho.crm.api.roles import Role
from zcrmsdk.src.com.zoho.crm.api.profiles import Profile
from zcrmsdk.src.com.zoho.crm.api import ParameterMap, HeaderMap
from datetime import datetime
class User(object):
    @staticmethod
    def get_users():

        """
        This method is used to retrieve the users data specified in the API request.
        """

        # Get instance of UsersOperations Class
        users_operations = UsersOperations()

        # Get instance of ParameterMap Class
        param_instance = ParameterMap()

        # Possible parameters for Get Users operation
        param_instance.add(GetUsersParam.page, 1)

        param_instance.add(GetUsersParam.per_page, 200)

        param_instance.add(GetUsersParam.type, 'ActiveConfirmedUsers')

        # Get instance of ParameterMap Class
        header_instance = HeaderMap()

        # Possible headers for Get Users operation
        header_instance.add(GetUsersHeader.if_modified_since, datetime.fromisoformat('2019-07-07T10:00:00+05:30'))

        # Call get_users method that takes ParameterMap instance and HeaderMap instance as parameters
        response = users_operations.get_users(param_instance, header_instance)

        if response is not None:

            # Get the status code from response
            print('Status Code: ' + str(response.get_status_code()))

            if response.get_status_code() in [204, 304]:
                print('No Content' if response.get_status_code() == 204 else 'Not Modified')
                return

            # Get object from response
            response_object = response.get_object()

            if response_object is not None:

                # Check if expected ResponseWrapper instance is received.
                if isinstance(response_object, ResponseWrapper):

                    # Get the list of obtained User instances
                    user_list = response_object.get_users()

                    for user in user_list:
                        # Get the Country of each User
                        print("User Country: " + str(user.get_country()))

                        # Get the CustomizeInfo instance of each User
                        customize_info = user.get_customize_info()

                        # Check if customizeInfo is not None
                        if customize_info is not None:
                            if customize_info.get_notes_desc() is not None:
                                # Get the NotesDesc of each User
                                print("User CustomizeInfo NotesDesc: " + str(customize_info.get_notes_desc()))

                            if customize_info.get_show_right_panel() is not None:
                                # Get the ShowRightPanel of each User
                                print("User CustomizeInfo ShowRightPanel: " + str(customize_info.get_show_right_panel()))

                            if customize_info.get_bc_view() is not None:
                                # Get the BcView of each User
                                print("User CustomizeInfo BcView: " + str(customize_info.get_bc_view()))

                            if customize_info.get_show_home() is not None:
                                # Get the ShowHome of each User
                                print("User CustomizeInfo ShowHome: " + str(customize_info.get_show_home()))

                            if customize_info.get_show_detail_view() is not None:
                                # Get the ShowDetailView of each User
                                print("User CustomizeInfo ShowDetailView: " + str(customize_info.get_show_detail_view()))

                            if customize_info.get_unpin_recent_item() is not None:
                                # Get the UnpinRecentItem of each User
                                print("User CustomizeInfo UnpinRecentItem: " + str(customize_info.get_unpin_recent_item()))

                        # Get the Role instance of each User
                        role = user.get_role()

                        if role is not None:
                            # Get the Name of Role
                            print("User Role Name: " + str(role.get_name()))

                            # Get the ID of Role
                            print("User Role ID: " + str(role.get_id()))

                        # Get the Signature of each User
                        print("User Signature: " + str(user.get_signature()))

                        # Get the City of each User
                        print("User City: " + str(user.get_city()))

                        # Get the NameFormat of each User
                        print("User NameFormat: " + str(user.get_name_format()))

                        # Get the Language of each User
                        print("User Language: " + str(user.get_language()))

                        # Get the Locale of each User
                        print("User Locale: " + str(user.get_locale()))

                        # Get the Microsoft of each User
                        print("User Microsoft: " + str(user.get_microsoft()))

                        if user.get_personal_account() is not None:
                            # Get the PersonalAccount of each User
                            print("User PersonalAccount: " + str(user.get_personal_account()))

                        # Get the DefaultTabGroup of each User
                        print("User DefaultTabGroup: " + str(user.get_default_tab_group()))

                        # Get the Isonline of each User
                        print("User Isonline: " + str(user.get_isonline()))

                        # Get the modifiedBy User instance of each User
                        modified_by = user.get_modified_by()

                        # Check if modified_by is not null
                        if modified_by is not None:
                            # Get the Name of the modifiedBy User
                            print("User Modified By User-Name: " + str(modified_by.get_name()))

                            # Get the ID of the modifiedBy User
                            print("User Modified By User-ID: " + str(modified_by.get_id()))

                        # Get the Street of each User
                        print("User Street: " + str(user.get_street()))

                        # Get the Currency of each User
                        print("User Currency: " + str(user.get_currency()))

                        # Get the Alias of each User
                        print("User Alias: " + str(user.get_alias()))

                        # Get the Theme instance of each User
                        theme = user.get_theme()

                        # Check if theme is not None
                        if theme is not None:
                            # Get the TabTheme instance of Theme
                            normal_tab = theme.get_normal_tab()

                            # Check if normal_tab is not null
                            if normal_tab is not None:
                                # Get the FontColor of NormalTab
                                print("User Theme NormalTab FontColor: " + str(normal_tab.get_font_color()))

                                # Get the Background of NormalTab
                                print("User Theme NormalTab Background: " + str(normal_tab.get_background()))

                            # Get the TabTheme instance of Theme
                            selected_tab = theme.get_selected_tab()

                            # Check if selected_tab is not null
                            if selected_tab is not None:
                                # Get the FontColor of selected_tab
                                print("User Theme Selected Tab FontColor: " + str(selected_tab.get_font_color()))

                                # Get the Background of selected_tab
                                print("User Theme Selected Tab Background: " + str(selected_tab.get_background()))

                            # Get the NewBackground of each Theme
                            print("User Theme NewBackground: " + str(theme.get_new_background()))

                            # Get the Background of each Theme
                            print("User Theme Background: " + str(theme.get_background()))

                            # Get the Screen of each Theme
                            print("User Theme Screen: " + str(theme.get_screen()))

                            # Get the Type of each Theme
                            print("User Theme Type: " + str(theme.get_type()))

                        # Get the ID of each User
                        print("User ID: " + str(user.get_id()))

                        # Get the State of each User
                        print("User State: " + str(user.get_state()))

                        # Get the Fax of each User
                        print("User Fax: " + str(user.get_fax()))

                        # Get the CountryLocale of each User
                        print("User CountryLocale: " + str(user.get_country_locale()))

                        # Get the FirstName of each User
                        print("User FirstName: " + str(user.get_first_name()))

                        # Get the Email of each User
                        print("User Email: " + str(user.get_email()))

                        # Get the reportingTo User instance of each User
                        reporting_to = user.get_reporting_to()

                        # Check if reporting_to is not None
                        if reporting_to is not None:
                            # Get the Name of the reporting_to User
                            print("User ReportingTo User-Name: " + str(reporting_to.get_name()))

                            # Get the ID of the reporting_to User
                            print("User ReportingTo User-ID: " + str(reporting_to.get_id()))

                        # Get the DecimalSeparator of each User
                        print("User DecimalSeparator: " + str(user.get_decimal_separator()))

                        # Get the Zip of each User
                        print("User Zip: " + str(user.get_zip()))

                        # Get the CreatedTime of each User
                        print("User CreatedTime: " + str(user.get_created_time()))

                        # Get the Website of each User
                        print("User Website: " + str(user.get_website()))

                        if user.get_modified_time() is not None:
                            # Get the ModifiedTime of each User
                            print("User ModifiedTime: " + str(user.get_modified_time()))

                        # Get the TimeFormat of each User
                        print("User TimeFormat: " + str(user.get_time_format()))

                        # Get the Offset of each User
                        print("User Offset: " + str(user.get_offset()))

                        # Get the Profile instance of each User
                        profile = user.get_profile()

                        # Check if profile is not None
                        if profile is not None:
                            # Get the Name of the profile
                            print("User Profile Name: " + str(profile.get_name()))

                            # Get the ID of the profile
                            print("User Profile ID: " + str(profile.get_id()))

                        # Get the Mobile of each User
                        print("User Mobile: " + str(user.get_mobile()))

                        # Get the LastName of each User
                        print("User LastName: " + str(user.get_last_name()))

                        # Get the TimeZone of each User
                        print("User TimeZone: " + str(user.get_time_zone()))

                        # Get the Custom Fields, if any
                        print("Custom Field: " + str(user.get_key_value('Custom_Field')))

                        # Get the created_by User instance of each User
                        created_by = user.get_created_by()

                        # Check if created_by is not None
                        if created_by is not None:
                            # Get the Name of the created_by User
                            print("User Created By User-Name: " + str(created_by.get_name()))

                            # Get the ID of the created_by User
                            print("User Created By User-ID: " + str(created_by.get_id()))

                        # Get the Zuid of each User
                        print("User Zuid: " + str(user.get_zuid()))

                        # Get the Confirm of each User
                        print("User Confirm: " + str(user.get_confirm()))

                        # Get the FullName of each User
                        print("User FullName: " + str(user.get_full_name()))

                        # Get the list of obtained Territory instances
                        territories = user.get_territories()

                        # Check if territories is not None
                        if territories is not None:
                            for territory in territories:
                                # Get the Manager of the Territory
                                print("User Territory Manager: " + str(territory.get_manager()))

                                # Get the Name of the Territory
                                print("User Territory Name: " + str(territory.get_name()))

                                # Get the ID of the Territory
                                print("User Territory ID: " + str(territory.get_id()))

                        # Get the Phone of each User
                        print("User Phone: " + str(user.get_phone()))

                        # Get the DOB of each User
                        print("User DOB: " + str(user.get_dob()))

                        # Get the DateFormat of each User
                        print("User DateFormat: " + str(user.get_date_format()))

                        # Get the Status of each User
                        print("User Status: " + str(user.get_status()))

                    # Get the obtained Info object
                    info = response_object.get_info()

                    if info is not None:
                        if info.get_per_page() is not None:
                            # Get the PerPage of the Info
                            print("User Info PerPage: " + str(info.get_per_page()))

                        if info.get_count() is not None:
                            # Get the Count of the Info
                            print("User Info Count: " + str(info.get_count()))

                        if info.get_page() is not None:
                            # Get the Page of the Info
                            print("User Info Page: " + str(info.get_page()))

                        if info.get_more_records() is not None:
                            # Get the MoreRecords of the Info
                            print("User Info MoreRecords: " + str(info.get_more_records()))

                # Check if the request returned an exception
                elif isinstance(response_object, APIException):
                    # Get the Status
                    print("Status: " + response_object.get_status().get_value())

                    # Get the Code
                    print("Code: " + response_object.get_code().get_value())

                    print("Details")

                    # Get the details dict
                    details = response_object.get_details()

                    for key, value in details.items():
                        print(key + ' : ' + str(value))

                    # Get the Message
                    print("Message: " + response_object.get_message().get_value())
 
Add User
              
              
from zcrmsdk.src.com.zoho.crm.api.users import *
from zcrmsdk.src.com.zoho.crm.api.users import User as ZCRMUser
from zcrmsdk.src.com.zoho.crm.api.roles import Role
from zcrmsdk.src.com.zoho.crm.api.profiles import Profile
from zcrmsdk.src.com.zoho.crm.api import ParameterMap, HeaderMap
from datetime import datetime
class User(object):
    @staticmethod
    def create_user():

        """
        This method is used to add a user to your organization and print the response.
        """

        # Get instance of UsersOperations Class
        users_operations = UsersOperations()

        # Get instance of RequestWrapper Class that will contain the request body
        request = RequestWrapper()

        # List to hold User instances
        user_list = []

        # Get instance of User Class
        user = ZCRMUser()

        # Get instance of Role Class
        role = Role()

        # Set ID to Role instance
        role.set_id(3477061000000026008)

        # Set role instance to role in User
        user.set_role(role)

        user.set_country_locale('en_US')

        user.set_first_name('Test')

        user.set_last_name('User')

        user.set_email('testuser@zoho.com')

        # Get instance of Profile Class
        profile = Profile()

        # Set ID to Profile instance
        profile.set_id(3477061000000026014)

        # Set profile instance to profile in User instance
        user.set_profile(profile)

        # Add the User instance to list
        user_list.append(user)

        # Set the list to users in BodyWrapper instance
        request.set_users(user_list)

        # Call create_user method that takes RequestWrapper class instance as parameter
        response = users_operations.create_user(request)

        if response is not None:
            # Get the status code from response
            print('Status Code: ' + str(response.get_status_code()))

            # Get object from response
            response_object = response.get_object()

            if response_object is not None:

                # Check if expected ActionWrapper instance is received.
                if isinstance(response_object, ActionWrapper):

                    # Get the list of obtained ActionResponse instances
                    action_response_list = response_object.get_users()

                    for action_response in action_response_list:

                        # Check if the request is successful
                        if isinstance(action_response, SuccessResponse):
                            # Get the Status
                            print("Status: " + action_response.get_status().get_value())

                            # Get the Code
                            print("Code: " + action_response.get_code().get_value())

                            print("Details")

                            # Get the details dict
                            details = action_response.get_details()

                            for key, value in details.items():
                                print(key + ' : ' + str(value))

                            # Get the Message
                            print("Message: " + action_response.get_message().get_value())

                        # Check if the request returned an exception
                        elif isinstance(action_response, APIException):
                            # Get the Status
                            print("Status: " + action_response.get_status().get_value())

                            # Get the Code
                            print("Code: " + action_response.get_code().get_value())

                            print("Details")

                            # Get the details dict
                            details = action_response.get_details()

                            for key, value in details.items():
                                print(key + ' : ' + str(value))

                            # Get the Message
                            print("Message: " + action_response.get_message().get_value())

                # Check if the request returned an exception
                elif isinstance(response_object, APIException):
                    # Get the Status
                    print("Status: " + response_object.get_status().get_value())

                    # Get the Code
                    print("Code: " + response_object.get_code().get_value())

                    print("Details")

                    # Get the details dict
                    details = response_object.get_details()

                    for key, value in details.items():
                        print(key + ' : ' + str(value))

                    # Get the Message
                    print("Message: " + response_object.get_message().get_value())
 
Update Users
Get a User
              
              
from zcrmsdk.src.com.zoho.crm.api.users import *
from zcrmsdk.src.com.zoho.crm.api.users import User as ZCRMUser
from zcrmsdk.src.com.zoho.crm.api.roles import Role
from zcrmsdk.src.com.zoho.crm.api.profiles import Profile
from zcrmsdk.src.com.zoho.crm.api import ParameterMap, HeaderMap
from datetime import datetime
class User(object):
    @staticmethod
    def get_user(user_id):

        """
        This method is used to get the details of any specific user with ID
        :param user_id: The ID of the User to be obtained
        """

        """
        example
        user_id = 3409643000000302031
        """

        # Get instance of UsersOperations Class
        users_operations = UsersOperations()

        # Get instance of ParameterMap Class
        header_instance = HeaderMap()

        # Possible headers for Get User operation
        header_instance.add(GetUserHeader.if_modified_since, datetime.fromisoformat('2019-07-07T10:00:00+05:30'))

        # Call get_user method that takes HeaderMap instance and user_id as parameters
        response = users_operations.get_user(user_id, header_instance)

        if response is not None:

            # Get the status code from response
            print('Status Code: ' + str(response.get_status_code()))

            if response.get_status_code() in [204, 304]:
                print('No Content' if response.get_status_code() == 204 else 'Not Modified')
                return

            # Get object from response
            response_object = response.get_object()

            if response_object is not None:

                # Check if expected ResponseWrapper instance is received.
                if isinstance(response_object, ResponseWrapper):

                    # Get the list of obtained User instances
                    user_list = response_object.get_users()

                    for user in user_list:
                        # Get the Country of each User
                        print("User Country: " + str(user.get_country()))

                        # Get the CustomizeInfo instance of each User
                        customize_info = user.get_customize_info()

                        # Check if customizeInfo is not None
                        if customize_info is not None:
                            if customize_info.get_notes_desc() is not None:
                                # Get the NotesDesc of each User
                                print("User CustomizeInfo NotesDesc: " + str(customize_info.get_notes_desc()))

                            if customize_info.get_show_right_panel() is not None:
                                # Get the ShowRightPanel of each User
                                print(
                                    "User CustomizeInfo ShowRightPanel: " + str(customize_info.get_show_right_panel()))

                            if customize_info.get_bc_view() is not None:
                                # Get the BcView of each User
                                print("User CustomizeInfo BcView: " + str(customize_info.get_bc_view()))

                            if customize_info.get_show_home() is not None:
                                # Get the ShowHome of each User
                                print("User CustomizeInfo ShowHome: " + str(customize_info.get_show_home()))

                            if customize_info.get_show_detail_view() is not None:
                                # Get the ShowDetailView of each User
                                print(
                                    "User CustomizeInfo ShowDetailView: " + str(customize_info.get_show_detail_view()))

                            if customize_info.get_unpin_recent_item() is not None:
                                # Get the UnpinRecentItem of each User
                                print("User CustomizeInfo UnpinRecentItem: " + str(
                                    customize_info.get_unpin_recent_item()))

                        # Get the Role instance of each User
                        role = user.get_role()

                        if role is not None:
                            # Get the Name of Role
                            print("User Role Name: " + str(role.get_name()))

                            # Get the ID of Role
                            print("User Role ID: " + str(role.get_id()))

                        # Get the Signature of each User
                        print("User Signature: " + str(user.get_signature()))

                        # Get the City of each User
                        print("User City: " + str(user.get_city()))

                        # Get the NameFormat of each User
                        print("User NameFormat: " + str(user.get_name_format()))

                        # Get the Language of each User
                        print("User Language: " + str(user.get_language()))

                        # Get the Locale of each User
                        print("User Locale: " + str(user.get_locale()))

                        # Get the Microsoft of each User
                        print("User Microsoft: " + str(user.get_microsoft()))

                        if user.get_personal_account() is not None:
                            # Get the PersonalAccount of each User
                            print("User PersonalAccount: " + str(user.get_personal_account()))

                        # Get the DefaultTabGroup of each User
                        print("User DefaultTabGroup: " + str(user.get_default_tab_group()))

                        # Get the Isonline of each User
                        print("User Isonline: " + str(user.get_isonline()))

                        # Get the modifiedBy User instance of each User
                        modified_by = user.get_modified_by()

                        # Check if modified_by is not null
                        if modified_by is not None:
                            # Get the Name of the modifiedBy User
                            print("User Modified By User-Name: " + str(modified_by.get_name()))

                            # Get the ID of the modifiedBy User
                            print("User Modified By User-ID: " + str(modified_by.get_id()))

                        # Get the Street of each User
                        print("User Street: " + str(user.get_street()))

                        # Get the Currency of each User
                        print("User Currency: " + str(user.get_currency()))

                        # Get the Alias of each User
                        print("User Alias: " + str(user.get_alias()))

                        # Get the Theme instance of each User
                        theme = user.get_theme()

                        # Check if theme is not None
                        if theme is not None:
                            # Get the TabTheme instance of Theme
                            normal_tab = theme.get_normal_tab()

                            # Check if normal_tab is not null
                            if normal_tab is not None:
                                # Get the FontColor of NormalTab
                                print("User Theme NormalTab FontColor: " + str(normal_tab.get_font_color()))

                                # Get the Background of NormalTab
                                print("User Theme NormalTab Background: " + str(normal_tab.get_background()))

                            # Get the TabTheme instance of Theme
                            selected_tab = theme.get_selected_tab()

                            # Check if selected_tab is not null
                            if selected_tab is not None:
                                # Get the FontColor of selected_tab
                                print("User Theme Selected Tab FontColor: " + str(selected_tab.get_font_color()))

                                # Get the Background of selected_tab
                                print("User Theme Selected Tab Background: " + str(selected_tab.get_background()))

                            # Get the NewBackground of each Theme
                            print("User Theme NewBackground: " + str(theme.get_new_background()))

                            # Get the Background of each Theme
                            print("User Theme Background: " + str(theme.get_background()))

                            # Get the Screen of each Theme
                            print("User Theme Screen: " + str(theme.get_screen()))

                            # Get the Type of each Theme
                            print("User Theme Type: " + str(theme.get_type()))

                        # Get the ID of each User
                        print("User ID: " + str(user.get_id()))

                        # Get the State of each User
                        print("User State: " + str(user.get_state()))

                        # Get the Fax of each User
                        print("User Fax: " + str(user.get_fax()))

                        # Get the CountryLocale of each User
                        print("User CountryLocale: " + str(user.get_country_locale()))

                        # Get the FirstName of each User
                        print("User FirstName: " + str(user.get_first_name()))

                        # Get the Email of each User
                        print("User Email: " + str(user.get_email()))

                        # Get the reportingTo User instance of each User
                        reporting_to = user.get_reporting_to()

                        # Check if reporting_to is not None
                        if reporting_to is not None:
                            # Get the Name of the reporting_to User
                            print("User ReportingTo User-Name: " + str(reporting_to.get_name()))

                            # Get the ID of the reporting_to User
                            print("User ReportingTo User-ID: " + str(reporting_to.get_id()))

                        # Get the DecimalSeparator of each User
                        print("User DecimalSeparator: " + str(user.get_decimal_separator()))

                        # Get the Zip of each User
                        print("User Zip: " + str(user.get_zip()))

                        # Get the CreatedTime of each User
                        print("User CreatedTime: " + str(user.get_created_time()))

                        # Get the Website of each User
                        print("User Website: " + str(user.get_website()))

                        if user.get_modified_time() is not None:
                            # Get the ModifiedTime of each User
                            print("User ModifiedTime: " + str(user.get_modified_time()))

                        # Get the TimeFormat of each User
                        print("User TimeFormat: " + str(user.get_time_format()))

                        # Get the Offset of each User
                        print("User Offset: " + str(user.get_offset()))

                        # Get the Profile instance of each User
                        profile = user.get_profile()

                        # Check if profile is not None
                        if profile is not None:
                            # Get the Name of the profile
                            print("User Profile Name: " + str(profile.get_name()))

                            # Get the ID of the profile
                            print("User Profile ID: " + str(profile.get_id()))

                        # Get the Mobile of each User
                        print("User Mobile: " + str(user.get_mobile()))

                        # Get the LastName of each User
                        print("User LastName: " + str(user.get_last_name()))

                        # Get the TimeZone of each User
                        print("User TimeZone: " + str(user.get_time_zone()))

                        # Get the Custom Fields, if any
                        print("Custom Field: " + str(user.get_key_value('Custom_Field')))

                        # Get the created_by User instance of each User
                        created_by = user.get_created_by()

                        # Check if created_by is not None
                        if created_by is not None:
                            # Get the Name of the created_by User
                            print("User Created By User-Name: " + str(created_by.get_name()))

                            # Get the ID of the created_by User
                            print("User Created By User-ID: " + str(created_by.get_id()))

                        # Get the Zuid of each User
                        print("User Zuid: " + str(user.get_zuid()))

                        # Get the Confirm of each User
                        print("User Confirm: " + str(user.get_confirm()))

                        # Get the FullName of each User
                        print("User FullName: " + str(user.get_full_name()))

                        # Get the list of obtained Territory instances
                        territories = user.get_territories()

                        # Check if territories is not None
                        if territories is not None:
                            for territory in territories:
                                # Get the Manager of the Territory
                                print("User Territory Manager: " + str(territory.get_manager()))

                                # Get the Name of the Territory
                                print("User Territory Name: " + str(territory.get_name()))

                                # Get the ID of the Territory
                                print("User Territory ID: " + str(territory.get_id()))

                        # Get the Phone of each User
                        print("User Phone: " + str(user.get_phone()))

                        # Get the DOB of each User
                        print("User DOB: " + str(user.get_dob()))

                        # Get the DateFormat of each User
                        print("User DateFormat: " + str(user.get_date_format()))

                        # Get the Status of each User
                        print("User Status: " + str(user.get_status()))

                # Check if the request returned an exception
                elif isinstance(response_object, APIException):
                    # Get the Status
                    print("Status: " + response_object.get_status().get_value())

                    # Get the Code
                    print("Code: " + response_object.get_code().get_value())

                    print("Details")

                    # Get the details dict
                    details = response_object.get_details()

                    for key, value in details.items():
                        print(key + ' : ' + str(value))

                    # Get the Message
                    print("Message: " + response_object.get_message().get_value())
 
Update a User
              
              
from zcrmsdk.src.com.zoho.crm.api.users import *
from zcrmsdk.src.com.zoho.crm.api.users import User as ZCRMUser
from zcrmsdk.src.com.zoho.crm.api.roles import Role
from zcrmsdk.src.com.zoho.crm.api.profiles import Profile
from zcrmsdk.src.com.zoho.crm.api import ParameterMap, HeaderMap
from datetime import datetime
class User(object):
    @staticmethod
    def update_user(user_id):

        """
        This method is used to update the details of any specific user with ID
        :param user_id: The ID of the User to be updated
        """

        """
        example
        user_id = 3409643000000302031
        """

        # Get instance of UsersOperations Class
        users_operations = UsersOperations()

        # Get instance of BodyWrapper Class that will contain the request body
        request = BodyWrapper()

        # List to hold User instances
        user_list = []

        # Get instance of User Class
        user_1 = ZCRMUser()

        # Get instance of Role Class
        role = Role()

        # Set ID to Role instance
        role.set_id(3477061000000026008)

        # Set role instance to role in User
        user_1.set_role(role)

        # Add User instance to list
        user_list.append(user_1)

        # Set the list to users in BodyWrapper
        request.set_users(user_list)

        # Call update_user method that takes BodyWrapper instance and user_id as parameters
        response = users_operations.update_user(user_id, request)

        if response is not None:
            # Get the status code from response
            print('Status Code: ' + str(response.get_status_code()))

            # Get object from response
            response_object = response.get_object()

            if response_object is not None:

                # Check if expected ActionWrapper instance is received.
                if isinstance(response_object, ActionWrapper):

                    # Get the list of obtained ActionResponse instances
                    action_response_list = response_object.get_users()

                    for action_response in action_response_list:

                        # Check if the request is successful
                        if isinstance(action_response, SuccessResponse):
                            # Get the Status
                            print("Status: " + action_response.get_status().get_value())

                            # Get the Code
                            print("Code: " + action_response.get_code().get_value())

                            print("Details")

                            # Get the details dict
                            details = action_response.get_details()

                            for key, value in details.items():
                                print(key + ' : ' + str(value))

                            # Get the Message
                            print("Message: " + action_response.get_message().get_value())

                        # Check if the request returned an exception
                        elif isinstance(action_response, APIException):
                            # Get the Status
                            print("Status: " + action_response.get_status().get_value())

                            # Get the Code
                            print("Code: " + action_response.get_code().get_value())

                            print("Details")

                            # Get the details dict
                            details = action_response.get_details()

                            for key, value in details.items():
                                print(key + ' : ' + str(value))

                            # Get the Message
                            print("Message: " + action_response.get_message().get_value())

                # Check if the request returned an exception
                elif isinstance(response_object, APIException):
                    # Get the Status
                    print("Status: " + response_object.get_status().get_value())

                    # Get the Code
                    print("Code: " + response_object.get_code().get_value())

                    print("Details")

                    # Get the details dict
                    details = response_object.get_details()

                    for key, value in details.items():
                        print(key + ' : ' + str(value))

                    # Get the Message
                    print("Message: " + response_object.get_message().get_value())
 
Delete a User
              
              
from zcrmsdk.src.com.zoho.crm.api.users import *
from zcrmsdk.src.com.zoho.crm.api.users import User as ZCRMUser
from zcrmsdk.src.com.zoho.crm.api.roles import Role
from zcrmsdk.src.com.zoho.crm.api.profiles import Profile
from zcrmsdk.src.com.zoho.crm.api import ParameterMap, HeaderMap
from datetime import datetime
class User(object):
    @staticmethod
    def delete_user(user_id):

        """
        This method is used to delete a user from your organization and print the response.
        :param user_id: The ID of the User to be deleted
        """

        """
        example
        user_id = 3409643000000302031
        """

        # Get instance of UsersOperations Class
        users_operations = UsersOperations()

        # Call delete_user method that takes user_id as parameter
        response = users_operations.delete_user(user_id)

        if response is not None:
            # Get the status code from response
            print('Status Code: ' + str(response.get_status_code()))

            # Get object from response
            response_object = response.get_object()

            if response_object is not None:

                # Check if expected ActionWrapper instance is received.
                if isinstance(response_object, ActionWrapper):

                    # Get the list of obtained ActionResponse instances
                    action_response_list = response_object.get_users()

                    for action_response in action_response_list:

                        # Check if the request is successful
                        if isinstance(action_response, SuccessResponse):
                            # Get the Status
                            print("Status: " + action_response.get_status().get_value())

                            # Get the Code
                            print("Code: " + action_response.get_code().get_value())

                            print("Details")

                            # Get the details dict
                            details = action_response.get_details()

                            for key, value in details.items():
                                print(key + ' : ' + str(value))

                            # Get the Message
                            print("Message: " + action_response.get_message().get_value())

                        # Check if the request returned an exception
                        elif isinstance(action_response, APIException):
                            # Get the Status
                            print("Status: " + action_response.get_status().get_value())

                            # Get the Code
                            print("Code: " + action_response.get_code().get_value())

                            print("Details")

                            # Get the details dict
                            details = action_response.get_details()

                            for key, value in details.items():
                                print(key + ' : ' + str(value))

                            # Get the Message
                            print("Message: " + action_response.get_message().get_value())

                # Check if the request returned an exception
                elif isinstance(response_object, APIException):
                    # Get the Status
                    print("Status: " + response_object.get_status().get_value())

                    # Get the Code
                    print("Code: " + response_object.get_code().get_value())

                    print("Details")

                    # Get the details dict
                    details = response_object.get_details()

                    for key, value in details.items():
                        print(key + ' : ' + str(value))

                    # Get the Message
                    print("Message: " + response_object.get_message().get_value())