Your use case. Our milestone. The 200th post in our "Kaizen Series: Continuous Improvement for Developer Experience" is coming up. Share Now

X
Skip to main content
close
EXPLORE ALL PRODUCTS

Sales

CRM

Comprehensive CRM platform for customer-facing teams.

CRM
Voice

Cloud Contact Center Software for businesses.

Voice
Sign

Digital signature app for businesses.

Sign
Forms

Build online forms for every business need.

Forms
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
Bookings

Appointment scheduling app for consultations with customers.

Bookings
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
Thrive

Complete loyalty and affiliate management platform.

Thrive
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

Campaigns

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

Campaigns
Voice

Cloud Contact Center Software for businesses.

Voice
Sign

Digital signature app for businesses.

Sign
Forms

Build online forms for every business need.

Forms
Social

All-in-one social media management software.

Social
Survey

Design surveys to reach and interact with your audience.

Survey
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
Sites

Online website builder with extensive customisation options.

Sites
Backstage

End-to-end event management software.

Backstage
PageSense

Website conversion optimization and personalisation platform.

PageSense
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
Webinar

Webinar platform for webcasting online webinars.

Webinar
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
NEW
Domains

Easy domain registration, transfer, and secured DNS management.

Domains
NEW
CommunitySpaces

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

CommunitySpaces
Thrive

Complete loyalty and affiliate management platform.

Thrive
Publish

Manage all your local business listings on a single platform.

Publish
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce and POS

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
Voice

Cloud Contact Center Software for businesses.

Voice
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
Bookings

Appointment scheduling app for consultations with customers.

Bookings
FSM

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

FSM
Lens

Interactive remote assistance software with augmented reality.

Lens
Solo

The all-in-one toolkit for solopreneurs.

Solo
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

Books

Powerful accounting platform for growing businesses.

Books
Expense

Effortless expense reporting platform.

Expense
Sign

Digital signature app for businesses.

Sign
Inventory

Powerful stock management and inventory control software.

Inventory
FREE
Invoice

100% Free invoicing solution.

Invoice
Billing

End-to-end billing solution for your business.

Billing
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
Commerce

eCommerce platform to manage and market your online store.

Commerce
Checkout

Collect payments online with custom branded pages.

Checkout
Practice

Practice management software for accounting firms.

Practice
Solo

The all-in-one toolkit for solopreneurs.

Solo
NEW
Payments

Unified payment solution built for all businesses.

Payments
Suites
Finance Plus

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

Finance Plus

Email, Storage, and Collaboration

Mail

Secure email service for teams of all sizes.

Mail
Voice

Cloud Contact Center Software for businesses.

Voice
Sign

Digital signature app for businesses.

Sign
WorkDrive

Online file management for teams.

WorkDrive
Bookings

Appointment scheduling app for consultations with customers.

Bookings
Cliq

Stay in touch with teams no matter where you are.

Cliq
Notebook

Beautiful home for all your notes.

Notebook
Meeting

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

Meeting
Connect

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

Connect
Learn

Knowledge and learning management platform.

Learn
Office Integrator

Built in document editors for web apps.

Office Integrator
Writer

Word processor for focused writing and discussions.

Writer
TeamInbox

Shared inboxes for teams.

TeamInbox
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
Show

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

Show
Tables

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

Tables
Sheet

Spreadsheet software for collaborative teams.

Sheet
Office Suite

Powerful collaborative work platform for teams.

Office Suite
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
ToDo

Collaborative task management for individuals and teams.

ToDo
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

Expense

Effortless expense reporting platform.

Expense
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
People

Organize, automate, and simplify your HR processes.

People
Sign

Digital signature app for businesses.

Sign
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
Shifts

Employee scheduling and time tracking app.

Shifts
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
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
Assist

Remote support and unattended remote access software.

Assist
Vault

Online password manager for teams.

Vault
Directory

Workforce identity and access management solution for cloud businesses.

Directory
Lens

Interactive remote assistance software with augmented reality.

Lens
QEngine

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

QEngine
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
NEW
eProtect

Comprehensive email security and archiving for every business.

eProtect
FREE
OneAuth

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

OneAuth
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit

BI and Analytics

Analytics

Modern self-service BI and analytics platform.

Analytics
DataPrep

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

DataPrep
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT
Embedded BI

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

Embedded BI

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
Solo

The all-in-one toolkit for solopreneurs.

Solo
Suites
Projects Plus

Unified project management platform for intelligent, data-driven work.

Projects Plus

Developer Platforms

Creator

Build custom apps to simplify business processes.

Creator
Flow

Automate business workflows by creating smart integrations.

Flow
Office Integrator

Built in document editors for web apps.

Office Integrator
DataPrep

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

DataPrep
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
Tables

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

Tables
QEngine

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

QEngine
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
NEW
IoT

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

IoT
Apptics

Application analytics for all apps.

Apptics
Embedded BI

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

Embedded BI

IoT

NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT
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
Projects Plus

Unified project management platform for intelligent, data-driven work.

Try now
Projects 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 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

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 SortOrderPreference of each User
                        print("User SortOrderPreference: " + str(user.get_sort_order_preference()))

                        # Get the SandboxDeveloper of each User
                        print("User SandboxDeveloper: " + str(user.get_sandboxdeveloper()))

                        # 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(34770610026005)

        # 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-1234567@zoho.com')

        # Get instance of Profile Class
        profile = Profile()

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

        # 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
              
              
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_users():

        """
        This method is used to update the details of multiple users of your organization and print the response.
        """

        # 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()

        # Set ID to User instance
        user_1.set_id(347706112716004)

        # Get instance of Role Class
        role = Role()

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

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

        user_1.set_country_locale('en_US')

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

        # Get instance of User Class
        user_2 = ZCRMUser()

        # Set ID to User instance
        user_2.set_id(34096430302042)

        # Get instance of Role Class
        role = Role()

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

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

        user_2.set_country_locale('en_US')

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

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

        # Call update_users method that takes BodyWrapper instance as parameter
        response = users_operations.update_users(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())
 
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 = 34096430302031
        """

        # 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 SortOrderPreference of each User
                        print("User SortOrderPreference: " + str(user.get_sort_order_preference()))

                        # Get the SandboxDeveloper of each User
                        print("User SandboxDeveloper: " + str(user.get_sandboxdeveloper()))

                        # 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 = 34096430302031
        """

        # 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(34770610026005)

        # 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