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
SuitesNew

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

Try now

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

PHP SDK Samples - Organization Operations

These sample codes are only applicable for the latest version ( v2.0.0 ) of PHP SDK. Use this link for the previous version samples.

Users
Get User Details
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient

require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            /* For VERSION <=2.0.6 $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});*/
             $configuration = [];
            ZCRMRestClient::initialize($configuration);
    }
    public function getUser(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $responseIns=$orgIns->getUser("3524033000000191017");//to get the user 
        $userInstance=$responseIns->getData();//to get the user data in form ZCRMUser instance
        
        echo $userInstance->getId();//to get the user id
        echo $userInstance->getCountry();//to get the country of the user
        $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
        echo $roleInstance->getId();//to get the role id 
        echo $roleInstance->getName();//to get the role name
        $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
        if($customizeInstance!=null)
        {
            echo $customizeInstance->getNotesDesc();//to get the note description
            echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
            echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown 
            echo $customizeInstance->isBcView();//to check whether the business card view is enabled
            echo $customizeInstance->isToShowHome();//to check whether the home is shown
            echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
        }
        echo $userInstance->getCity();//to get the city of the user
        echo $userInstance->getSignature();//to get the signature of the user
        echo $userInstance->getNameFormat();// to get the name format of the user
        echo $userInstance->getLanguage();//to get the language of the user
        echo $userInstance->getLocale();//to get the locale of the user
        echo $userInstance->isPersonalAccount();//to check whther this is a personal account
        echo $userInstance->getDefaultTabGroup();//to get the default tab group
        echo $userInstance->getAlias();//to get the alias of the user
        echo $userInstance->getStreet();//to get the street name of the user
        $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme 
        if($themeInstance!=null)
        {
            echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
            echo $themeInstance->getNormalTabBackground();//to get the normal tab background
            echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
            echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
        }
        echo $userInstance->getState();//to get the state of the user
        echo $userInstance->getCountryLocale();//to get the country locale of the user 
        echo $userInstance->getFax();//to get the fax number of the user
        echo $userInstance->getFirstName();//to get the first name of the user
        echo $userInstance->getEmail();//to get the email id of the user
        echo $userInstance->getZip();//to get the zip code of the user
        echo $userInstance->getDecimalSeparator();//to get the decimal separator
        echo $userInstance->getWebsite();//to get the website of the user
        echo $userInstance->getTimeFormat();//to get the time format of the user
        $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
        echo $profile->getId();//to get the profile id
        echo $profile->getName();//to get the name of the profile
        echo $userInstance->getMobile();//to get the mobile number of the user
        echo $userInstance->getLastName();//to get the last name of the user
        echo $userInstance->getTimeZone();//to get the time zone of the user
        echo $userInstance->getZuid();//to get the zoho user id of the user
        echo $userInstance->isConfirm();//to check whether it is a confirmed user
        echo $userInstance->getFullName();//to get the full name of the user
        echo $userInstance->getPhone();//to get the phone number of the user
        echo $userInstance->getDob();//to get the date of birth of the user
        echo $userInstance->getDateFormat();//to get the date format
        echo $userInstance->getStatus();//to get the status of the user
        echo "HTTP Status Code:".$responseIns->getHttpStatusCode(); //To get http response code
        echo "Status:".$responseIns->getStatus(); //To get response status
        echo "Message:".$responseIns->getMessage(); //To get response message
        echo "Code:".$responseIns->getCode(); //To get status code
        echo "Details:".json_encode($responseIns->getDetails());
    }
}
    $obj =new Org();
    $obj->getUser();
 
Get All Users
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;

require 'vendor/autoload.php';

class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllUsers(){
       /* For VERSION <=2.0.6 $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $response=$orgIns->getAllUsers();//to get all the user*/
        $orgIns = ZCRMOrganization::getInstance(); // to get the organization instance
        $param_map=array("page"=>"20","per_page"=>"200"); // key-value pair containing all the parameters - optional
        $header_map = array("if-modified-since"=>"2019-11-10T15:26:49+05:30"); // key-value pair containing all the headers - optional
        $response = $orgIns->getAllUsers($param_map,$header_map); // to get all the user
        $userInstances=$response->getData();//to get the array of users in form of ZCRMUser instances
        foreach ($userInstances as $userInstance){
            echo $userInstance->getId();//to get the user id
            echo $userInstance->getCountry();//to get the country of the user
            $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
            echo $roleInstance->getId();//to get the role id
            echo $roleInstance->getName();//to get the role name
            $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
            if($customizeInstance!=null)
            {
                echo $customizeInstance->getNotesDesc();//to get the note description
                echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
                echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown
                echo $customizeInstance->isBcView();//to check whether the business card view is enabled
                echo $customizeInstance->isToShowHome();//to check whether the home is shown
                echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
            }
            echo $userInstance->getCity();//to get the city of the user
            echo $userInstance->getSignature();//to get the signature of the user
            echo $userInstance->getNameFormat();// to get the name format of the user
            echo $userInstance->getLanguage();//to get the language of the user
            echo $userInstance->getLocale();//to get the locale of the user
            echo $userInstance->isPersonalAccount();//to check whther this is a personal account
            echo $userInstance->getDefaultTabGroup();//to get the default tab group
            echo $userInstance->getAlias();//to get the alias of the user
            echo $userInstance->getStreet();//to get the street name of the user
            $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme
            if($themeInstance!=null)
            {
                echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
                echo $themeInstance->getNormalTabBackground();//to get the normal tab background
                echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
                echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
            }
            echo $userInstance->getState();//to get the state of the user
            echo $userInstance->getCountryLocale();//to get the country locale of the user
            echo $userInstance->getFax();//to get the fax number of the user
            echo $userInstance->getFirstName();//to get the first name of the user
            echo $userInstance->getEmail();//to get the email id of the user
            echo $userInstance->getZip();//to get the zip code of the user
            echo $userInstance->getDecimalSeparator();//to get the decimal separator
            echo $userInstance->getWebsite();//to get the website of the user
            echo $userInstance->getTimeFormat();//to get the time format of the user
            $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
            echo $profile->getId();//to get the profile id
            echo $profile->getName();//to get the name of the profile
            echo $userInstance->getMobile();//to get the mobile number of the user
            echo $userInstance->getLastName();//to get the last name of the user
            echo $userInstance->getTimeZone();//to get the time zone of the user
            echo $userInstance->getZuid();//to get the zoho user id of the user
            echo $userInstance->isConfirm();//to check whether it is a confirmed user
            echo $userInstance->getFullName();//to get the full name of the user
            echo $userInstance->getPhone();//to get the phone number of the user
            echo $userInstance->getDob();//to get the date of birth of the user
            echo $userInstance->getDateFormat();//to get the date format
            echo $userInstance->getStatus();//to get the status of the user
        }
        
    }
}
    $obj =new Org();
    $obj->getAllUsers();
 
Get All Active Users
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllActiveUsers(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        /* For VERSION <=2.0.6 $response=$orgIns->getAllActiveUsers();//to get all the active users*/
        $param_map=array("page"=>"20","per_page"=>"200"); // key-value pair containing all the parameters - optional
        $header_map = array("if-modified-since"=>"2019-11-10T15:26:49+05:30"); // key-value pair containing all the headers - optional
        $response = $orgIns->getAllActiveUsers($param_map,$header_map); // to get all the active users
        $userInstances=$response->getData();//to get the array of users in form of ZCRMUser instances
        foreach ($userInstances as $userInstance){
            echo $userInstance->getId();//to get the user id
            echo $userInstance->getCountry();//to get the country of the user
            $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
            echo $roleInstance->getId();//to get the role id
            echo $roleInstance->getName();//to get the role name
            $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
            if($customizeInstance!=null)
            {
                echo $customizeInstance->getNotesDesc();//to get the note description
                echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
                echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown
                echo $customizeInstance->isBcView();//to check whether the business card view is enabled
                echo $customizeInstance->isToShowHome();//to check whether the home is shown
                echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
            }
            echo $userInstance->getCity();//to get the city of the user
            echo $userInstance->getSignature();//to get the signature of the user
            echo $userInstance->getNameFormat();// to get the name format of the user
            echo $userInstance->getLanguage();//to get the language of the user
            echo $userInstance->getLocale();//to get the locale of the user
            echo $userInstance->isPersonalAccount();//to check whther this is a personal account
            echo $userInstance->getDefaultTabGroup();//to get the default tab group
            echo $userInstance->getAlias();//to get the alias of the user
            echo $userInstance->getStreet();//to get the street name of the user
            $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme
            if($themeInstance!=null)
            {
                echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
                echo $themeInstance->getNormalTabBackground();//to get the normal tab background
                echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
                echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
            }
            echo $userInstance->getState();//to get the state of the user
            echo $userInstance->getCountryLocale();//to get the country locale of the user
            echo $userInstance->getFax();//to get the fax number of the user
            echo $userInstance->getFirstName();//to get the first name of the user
            echo $userInstance->getEmail();//to get the email id of the user
            echo $userInstance->getZip();//to get the zip code of the user
            echo $userInstance->getDecimalSeparator();//to get the decimal separator
            echo $userInstance->getWebsite();//to get the website of the user
            echo $userInstance->getTimeFormat();//to get the time format of the user
            $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
            echo $profile->getId();//to get the profile id
            echo $profile->getName();//to get the name of the profile
            echo $userInstance->getMobile();//to get the mobile number of the user
            echo $userInstance->getLastName();//to get the last name of the user
            echo $userInstance->getTimeZone();//to get the time zone of the user
            echo $userInstance->getZuid();//to get the zoho user id of the user
            echo $userInstance->isConfirm();//to check whether it is a confirmed user
            echo $userInstance->getFullName();//to get the full name of the user
            echo $userInstance->getPhone();//to get the phone number of the user
            echo $userInstance->getDob();//to get the date of birth of the user
            echo $userInstance->getDateFormat();//to get the date format
            echo $userInstance->getStatus();//to get the status of the user
        }
    }
}
    $obj =new Org();
    $obj->getAllActiveUsers();
 
Get All Deactivated Users
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllDeactiveUsers(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        /* For VERSION <=2.0.6 $response=$orgIns->getAllDeactiveUsers();//to get all the deactivated users */
        $param_map=array("page"=>"20","per_page"=>"200"); // key-value pair containing all the parameters - optional
        $header_map = array("if-modified-since"=>"2019-11-10T15:26:49+05:30"); // key-value pair containing all the headers - optional
        $response = $orgIns->getAllDeactiveUsers($param_map,$header_map); // to get all the deactivated users
        $userInstances=$response->getData();//to get the array of users in form of ZCRMUser instances
        foreach ($userInstances as $userInstance){
            echo $userInstance->getId();//to get the user id
            echo $userInstance->getCountry();//to get the country of the user
            $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
            echo $roleInstance->getId();//to get the role id
            echo $roleInstance->getName();//to get the role name
            $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
            if($customizeInstance!=null)
            {
                echo $customizeInstance->getNotesDesc();//to get the note description
                echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
                echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown
                echo $customizeInstance->isBcView();//to check whether the business card view is enabled
                echo $customizeInstance->isToShowHome();//to check whether the home is shown
                echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
            }
            echo $userInstance->getCity();//to get the city of the user
            echo $userInstance->getSignature();//to get the signature of the user
            echo $userInstance->getNameFormat();// to get the name format of the user
            echo $userInstance->getLanguage();//to get the language of the user
            echo $userInstance->getLocale();//to get the locale of the user
            echo $userInstance->isPersonalAccount();//to check whther this is a personal account
            echo $userInstance->getDefaultTabGroup();//to get the default tab group
            echo $userInstance->getAlias();//to get the alias of the user
            echo $userInstance->getStreet();//to get the street name of the user
            $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme
            if($themeInstance!=null)
            {
                echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
                echo $themeInstance->getNormalTabBackground();//to get the normal tab background
                echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
                echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
            }
            echo $userInstance->getState();//to get the state of the user
            echo $userInstance->getCountryLocale();//to get the country locale of the user
            echo $userInstance->getFax();//to get the fax number of the user
            echo $userInstance->getFirstName();//to get the first name of the user
            echo $userInstance->getEmail();//to get the email id of the user
            echo $userInstance->getZip();//to get the zip code of the user
            echo $userInstance->getDecimalSeparator();//to get the decimal separator
            echo $userInstance->getWebsite();//to get the website of the user
            echo $userInstance->getTimeFormat();//to get the time format of the user
            $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
            echo $profile->getId();//to get the profile id
            echo $profile->getName();//to get the name of the profile
            echo $userInstance->getMobile();//to get the mobile number of the user
            echo $userInstance->getLastName();//to get the last name of the user
            echo $userInstance->getTimeZone();//to get the time zone of the user
            echo $userInstance->getZuid();//to get the zoho user id of the user
            echo $userInstance->isConfirm();//to check whether it is a confirmed user
            echo $userInstance->getFullName();//to get the full name of the user
            echo $userInstance->getPhone();//to get the phone number of the user
            echo $userInstance->getDob();//to get the date of birth of the user
            echo $userInstance->getDateFormat();//to get the date format
            echo $userInstance->getStatus();//to get the status of the user
        }
    }
}
    $obj =new Org();
    $obj->getAllDeactiveUsers();
 
Get All Confirmed Users
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllConfirmedUsers(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        /* For VERSION <=2.0.6 $response=$orgIns->getAllConfirmedUsers();//to get all the confirmed users*/
        $param_map=array("page"=>"20","per_page"=>"200"); // key-value pair containing all the parameters - optional
        $header_map = array("if-modified-since"=>"2019-11-10T15:26:49+05:30"); // key-value pair containing all the headers - optional
        $response = $orgIns->getAllConfirmedUsers($param_map,$header_map); // to get all the confirmed users
        $userInstances=$response->getData();//to get the array of users in form of ZCRMUser instances
        foreach ($userInstances as $userInstance){
            echo $userInstance->getId();//to get the user id
            echo $userInstance->getCountry();//to get the country of the user
            $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
            echo $roleInstance->getId();//to get the role id
            echo $roleInstance->getName();//to get the role name
            $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
            if($customizeInstance!=null)
            {
                echo $customizeInstance->getNotesDesc();//to get the note description
                echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
                echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown
                echo $customizeInstance->isBcView();//to check whether the business card view is enabled
                echo $customizeInstance->isToShowHome();//to check whether the home is shown
                echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
            }
            echo $userInstance->getCity();//to get the city of the user
            echo $userInstance->getSignature();//to get the signature of the user
            echo $userInstance->getNameFormat();// to get the name format of the user
            echo $userInstance->getLanguage();//to get the language of the user
            echo $userInstance->getLocale();//to get the locale of the user
            echo $userInstance->isPersonalAccount();//to check whther this is a personal account
            echo $userInstance->getDefaultTabGroup();//to get the default tab group
            echo $userInstance->getAlias();//to get the alias of the user
            echo $userInstance->getStreet();//to get the street name of the user
            $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme
            if($themeInstance!=null)
            {
                echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
                echo $themeInstance->getNormalTabBackground();//to get the normal tab background
                echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
                echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
            }
            echo $userInstance->getState();//to get the state of the user
            echo $userInstance->getCountryLocale();//to get the country locale of the user
            echo $userInstance->getFax();//to get the fax number of the user
            echo $userInstance->getFirstName();//to get the first name of the user
            echo $userInstance->getEmail();//to get the email id of the user
            echo $userInstance->getZip();//to get the zip code of the user
            echo $userInstance->getDecimalSeparator();//to get the decimal separator
            echo $userInstance->getWebsite();//to get the website of the user
            echo $userInstance->getTimeFormat();//to get the time format of the user
            $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
            echo $profile->getId();//to get the profile id
            echo $profile->getName();//to get the name of the profile
            echo $userInstance->getMobile();//to get the mobile number of the user
            echo $userInstance->getLastName();//to get the last name of the user
            echo $userInstance->getTimeZone();//to get the time zone of the user
            echo $userInstance->getZuid();//to get the zoho user id of the user
            echo $userInstance->isConfirm();//to check whether it is a confirmed user
            echo $userInstance->getFullName();//to get the full name of the user
            echo $userInstance->getPhone();//to get the phone number of the user
            echo $userInstance->getDob();//to get the date of birth of the user
            echo $userInstance->getDateFormat();//to get the date format
            echo $userInstance->getStatus();//to get the status of the user
        }
    }
}
    $obj =new Org();
    $obj->getAllConfirmedUsers();
 
Get All Non-Confirmed Users
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllNotConfirmedUsers(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        /* For VERSION <=2.0.6 $response=$orgIns->getAllNotConfirmedUsers();//to get all the nonconfirmed users*/
        $param_map=array("page"=>"20","per_page"=>"200"); // key-value pair containing all the parameters - optional
        $header_map = array("if-modified-since"=>"2019-11-10T15:26:49+05:30"); // key-value pair containing all the headers - optional
        $response = $orgIns->getAllNotConfirmedUsers($param_map,$header_map); // to get all the unconfirmed users
        $userInstances=$response->getData();//to get the array of users in form of ZCRMUser instances
        foreach ($userInstances as $userInstance){
            echo $userInstance->getId();//to get the user id
            echo $userInstance->getCountry();//to get the country of the user
            $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
            echo $roleInstance->getId();//to get the role id
            echo $roleInstance->getName();//to get the role name
            $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
            if($customizeInstance!=null)
            {
                echo $customizeInstance->getNotesDesc();//to get the note description
                echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
                echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown
                echo $customizeInstance->isBcView();//to check whether the business card view is enabled
                echo $customizeInstance->isToShowHome();//to check whether the home is shown
                echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
            }
            echo $userInstance->getCity();//to get the city of the user
            echo $userInstance->getSignature();//to get the signature of the user
            echo $userInstance->getNameFormat();// to get the name format of the user
            echo $userInstance->getLanguage();//to get the language of the user
            echo $userInstance->getLocale();//to get the locale of the user
            echo $userInstance->isPersonalAccount();//to check whther this is a personal account
            echo $userInstance->getDefaultTabGroup();//to get the default tab group
            echo $userInstance->getAlias();//to get the alias of the user
            echo $userInstance->getStreet();//to get the street name of the user
            $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme
            if($themeInstance!=null)
            {
                echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
                echo $themeInstance->getNormalTabBackground();//to get the normal tab background
                echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
                echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
            }
            echo $userInstance->getState();//to get the state of the user
            echo $userInstance->getCountryLocale();//to get the country locale of the user
            echo $userInstance->getFax();//to get the fax number of the user
            echo $userInstance->getFirstName();//to get the first name of the user
            echo $userInstance->getEmail();//to get the email id of the user
            echo $userInstance->getZip();//to get the zip code of the user
            echo $userInstance->getDecimalSeparator();//to get the decimal separator
            echo $userInstance->getWebsite();//to get the website of the user
            echo $userInstance->getTimeFormat();//to get the time format of the user
            $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
            echo $profile->getId();//to get the profile id
            echo $profile->getName();//to get the name of the profile
            echo $userInstance->getMobile();//to get the mobile number of the user
            echo $userInstance->getLastName();//to get the last name of the user
            echo $userInstance->getTimeZone();//to get the time zone of the user
            echo $userInstance->getZuid();//to get the zoho user id of the user
            echo $userInstance->isConfirm();//to check whether it is a confirmed user
            echo $userInstance->getFullName();//to get the full name of the user
            echo $userInstance->getPhone();//to get the phone number of the user
            echo $userInstance->getDob();//to get the date of birth of the user
            echo $userInstance->getDateFormat();//to get the date format
            echo $userInstance->getStatus();//to get the status of the user
        }
    }
}
    $obj =new Org();
    $obj->getAllNotConfirmedUsers();
 
Get All Deleted Users
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllDeletedUsers(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        /* For VERSION <=2.0.6 $response=$orgIns->getAllDeletedUsers();//to get all the deleted users*/
        $param_map=array("page"=>"20","per_page"=>"200"); // key-value pair containing all the parameters - optional
        $header_map = array("if-modified-since"=>"2019-11-10T15:26:49+05:30"); // key-value pair containing all the headers - optional
        $response = $orgIns->getAllDeletedUsers($param_map,$header_map); // to get all the deleted users
        $userInstances=$response->getData();//to get the array of users in form of ZCRMUser instances
        foreach ($userInstances as $userInstance){
            echo $userInstance->getId();//to get the user id
            echo $userInstance->getCountry();//to get the country of the user
            $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
            echo $roleInstance->getId();//to get the role id
            echo $roleInstance->getName();//to get the role name
            $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
            if($customizeInstance!=null)
            {
                echo $customizeInstance->getNotesDesc();//to get the note description
                echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
                echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown
                echo $customizeInstance->isBcView();//to check whether the business card view is enabled
                echo $customizeInstance->isToShowHome();//to check whether the home is shown
                echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
            }
            echo $userInstance->getCity();//to get the city of the user
            echo $userInstance->getSignature();//to get the signature of the user
            echo $userInstance->getNameFormat();// to get the name format of the user
            echo $userInstance->getLanguage();//to get the language of the user
            echo $userInstance->getLocale();//to get the locale of the user
            echo $userInstance->isPersonalAccount();//to check whther this is a personal account
            echo $userInstance->getDefaultTabGroup();//to get the default tab group
            echo $userInstance->getAlias();//to get the alias of the user
            echo $userInstance->getStreet();//to get the street name of the user
            $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme
            if($themeInstance!=null)
            {
                echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
                echo $themeInstance->getNormalTabBackground();//to get the normal tab background
                echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
                echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
            }
            echo $userInstance->getState();//to get the state of the user
            echo $userInstance->getCountryLocale();//to get the country locale of the user
            echo $userInstance->getFax();//to get the fax number of the user
            echo $userInstance->getFirstName();//to get the first name of the user
            echo $userInstance->getEmail();//to get the email id of the user
            echo $userInstance->getZip();//to get the zip code of the user
            echo $userInstance->getDecimalSeparator();//to get the decimal separator
            echo $userInstance->getWebsite();//to get the website of the user
            echo $userInstance->getTimeFormat();//to get the time format of the user
            $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
            echo $profile->getId();//to get the profile id
            echo $profile->getName();//to get the name of the profile
            echo $userInstance->getMobile();//to get the mobile number of the user
            echo $userInstance->getLastName();//to get the last name of the user
            echo $userInstance->getTimeZone();//to get the time zone of the user
            echo $userInstance->getZuid();//to get the zoho user id of the user
            echo $userInstance->isConfirm();//to check whether it is a confirmed user
            echo $userInstance->getFullName();//to get the full name of the user
            echo $userInstance->getPhone();//to get the phone number of the user
            echo $userInstance->getDob();//to get the date of birth of the user
            echo $userInstance->getDateFormat();//to get the date format
            echo $userInstance->getStatus();//to get the status of the user
        }
    }
    }
    $obj =new Org();
    $obj->getAllDeletedUsers();
 
Get All Active & Confirmed Users
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllActiveConfirmedUsers(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        /* For VERSION <=2.0.6 $response=$orgIns->getAllActiveConfirmedUsers();//to get all the confirmer active users*/
        $param_map=array("page"=>"20","per_page"=>"200"); // key-value pair containing all the parameters - optional
        $header_map = array("if-modified-since"=>"2019-11-10T15:26:49+05:30"); // key-value pair containing all the headers - optional
        $response = $orgIns->getAllActiveConfirmedUsers($param_map,$header_map); // to get all the active and confirmed users
        $userInstances=$response->getData();//to get the array of users in form of ZCRMUser instances
        foreach ($userInstances as $userInstance){
            echo $userInstance->getId();//to get the user id
            echo $userInstance->getCountry();//to get the country of the user
            $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
            echo $roleInstance->getId();//to get the role id
            echo $roleInstance->getName();//to get the role name
            $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
            if($customizeInstance!=null)
            {
                echo $customizeInstance->getNotesDesc();//to get the note description
                echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
                echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown
                echo $customizeInstance->isBcView();//to check whether the business card view is enabled
                echo $customizeInstance->isToShowHome();//to check whether the home is shown
                echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
            }
            echo $userInstance->getCity();//to get the city of the user
            echo $userInstance->getSignature();//to get the signature of the user
            echo $userInstance->getNameFormat();// to get the name format of the user
            echo $userInstance->getLanguage();//to get the language of the user
            echo $userInstance->getLocale();//to get the locale of the user
            echo $userInstance->isPersonalAccount();//to check whther this is a personal account
            echo $userInstance->getDefaultTabGroup();//to get the default tab group
            echo $userInstance->getAlias();//to get the alias of the user
            echo $userInstance->getStreet();//to get the street name of the user
            $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme
            if($themeInstance!=null)
            {
                echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
                echo $themeInstance->getNormalTabBackground();//to get the normal tab background
                echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
                echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
            }
            echo $userInstance->getState();//to get the state of the user
            echo $userInstance->getCountryLocale();//to get the country locale of the user
            echo $userInstance->getFax();//to get the fax number of the user
            echo $userInstance->getFirstName();//to get the first name of the user
            echo $userInstance->getEmail();//to get the email id of the user
            echo $userInstance->getZip();//to get the zip code of the user
            echo $userInstance->getDecimalSeparator();//to get the decimal separator
            echo $userInstance->getWebsite();//to get the website of the user
            echo $userInstance->getTimeFormat();//to get the time format of the user
            $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
            echo $profile->getId();//to get the profile id
            echo $profile->getName();//to get the name of the profile
            echo $userInstance->getMobile();//to get the mobile number of the user
            echo $userInstance->getLastName();//to get the last name of the user
            echo $userInstance->getTimeZone();//to get the time zone of the user
            echo $userInstance->getZuid();//to get the zoho user id of the user
            echo $userInstance->isConfirm();//to check whether it is a confirmed user
            echo $userInstance->getFullName();//to get the full name of the user
            echo $userInstance->getPhone();//to get the phone number of the user
            echo $userInstance->getDob();//to get the date of birth of the user
            echo $userInstance->getDateFormat();//to get the date format
            echo $userInstance->getStatus();//to get the status of the user
        }
    }
}
    $obj =new Org();
    $obj->getAllActiveConfirmedUsers();
 
Get All Admin Users
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllAdminUsers(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        /* For VERSION <=2.0.6 $response=$orgIns->getAllAdminUsers();//to get all the admins*/
        $param_map=array("page"=>"20","per_page"=>"200"); // key-value pair containing all the parameters - optional
        $header_map = array("if-modified-since"=>"2019-11-10T15:26:49+05:30"); // key-value pair containing all the headers - optional
        $response = $orgIns->getAllAdminUsers($param_map,$header_map); // to get all the administrators
        $userInstances=$response->getData();//to get the array of users in form of ZCRMUser instances
        foreach ($userInstances as $userInstance){
            echo $userInstance->getId();//to get the user id
            echo $userInstance->getCountry();//to get the country of the user
            $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
            echo $roleInstance->getId();//to get the role id
            echo $roleInstance->getName();//to get the role name
            $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
            if($customizeInstance!=null)
            {
                echo $customizeInstance->getNotesDesc();//to get the note description
                echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
                echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown
                echo $customizeInstance->isBcView();//to check whether the business card view is enabled
                echo $customizeInstance->isToShowHome();//to check whether the home is shown
                echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
            }
            echo $userInstance->getCity();//to get the city of the user
            echo $userInstance->getSignature();//to get the signature of the user
            echo $userInstance->getNameFormat();// to get the name format of the user
            echo $userInstance->getLanguage();//to get the language of the user
            echo $userInstance->getLocale();//to get the locale of the user
            echo $userInstance->isPersonalAccount();//to check whther this is a personal account
            echo $userInstance->getDefaultTabGroup();//to get the default tab group
            echo $userInstance->getAlias();//to get the alias of the user
            echo $userInstance->getStreet();//to get the street name of the user
            $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme
            if($themeInstance!=null)
            {
                echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
                echo $themeInstance->getNormalTabBackground();//to get the normal tab background
                echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
                echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
            }
            echo $userInstance->getState();//to get the state of the user
            echo $userInstance->getCountryLocale();//to get the country locale of the user
            echo $userInstance->getFax();//to get the fax number of the user
            echo $userInstance->getFirstName();//to get the first name of the user
            echo $userInstance->getEmail();//to get the email id of the user
            echo $userInstance->getZip();//to get the zip code of the user
            echo $userInstance->getDecimalSeparator();//to get the decimal separator
            echo $userInstance->getWebsite();//to get the website of the user
            echo $userInstance->getTimeFormat();//to get the time format of the user
            $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
            echo $profile->getId();//to get the profile id
            echo $profile->getName();//to get the name of the profile
            echo $userInstance->getMobile();//to get the mobile number of the user
            echo $userInstance->getLastName();//to get the last name of the user
            echo $userInstance->getTimeZone();//to get the time zone of the user
            echo $userInstance->getZuid();//to get the zoho user id of the user
            echo $userInstance->isConfirm();//to check whether it is a confirmed user
            echo $userInstance->getFullName();//to get the full name of the user
            echo $userInstance->getPhone();//to get the phone number of the user
            echo $userInstance->getDob();//to get the date of birth of the user
            echo $userInstance->getDateFormat();//to get the date format
            echo $userInstance->getStatus();//to get the status of the user
        }
    }
}
    $obj =new Org();
    $obj->getAllAdminUsers();
 
Get All Active & Confirmed Admins
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllActiveConfirmedAdmins(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        /* For VERSION <=2.0.6 $response=$orgIns->getAllActiveConfirmedAdmins();//to get all the confirmed admins*/
        $param_map=array("page"=>"20","per_page"=>"200"); // key-value pair containing all the parameters - optional
        $header_map = array("if-modified-since"=>"2019-11-10T15:26:49+05:30"); // key-value pair containing all the headers - optional
        $response = $orgIns->getAllActiveConfirmedAdmins($param_map,$header_map); // to get all the confirmed administrators
        $userInstances=$response->getData();//to get the array of users in form of ZCRMUser instances
        foreach ($userInstances as $userInstance){
            echo $userInstance->getId();//to get the user id
            echo $userInstance->getCountry();//to get the country of the user
            $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
            echo $roleInstance->getId();//to get the role id
            echo $roleInstance->getName();//to get the role name
            $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
            if($customizeInstance!=null)
            {
                echo $customizeInstance->getNotesDesc();//to get the note description
                echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
                echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown
                echo $customizeInstance->isBcView();//to check whether the business card view is enabled
                echo $customizeInstance->isToShowHome();//to check whether the home is shown
                echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
            }
            echo $userInstance->getCity();//to get the city of the user
            echo $userInstance->getSignature();//to get the signature of the user
            echo $userInstance->getNameFormat();// to get the name format of the user
            echo $userInstance->getLanguage();//to get the language of the user
            echo $userInstance->getLocale();//to get the locale of the user
            echo $userInstance->isPersonalAccount();//to check whther this is a personal account
            echo $userInstance->getDefaultTabGroup();//to get the default tab group
            echo $userInstance->getAlias();//to get the alias of the user
            echo $userInstance->getStreet();//to get the street name of the user
            $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme
            if($themeInstance!=null)
            {
                echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
                echo $themeInstance->getNormalTabBackground();//to get the normal tab background
                echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
                echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
            }
            echo $userInstance->getState();//to get the state of the user
            echo $userInstance->getCountryLocale();//to get the country locale of the user
            echo $userInstance->getFax();//to get the fax number of the user
            echo $userInstance->getFirstName();//to get the first name of the user
            echo $userInstance->getEmail();//to get the email id of the user
            echo $userInstance->getZip();//to get the zip code of the user
            echo $userInstance->getDecimalSeparator();//to get the decimal separator
            echo $userInstance->getWebsite();//to get the website of the user
            echo $userInstance->getTimeFormat();//to get the time format of the user
            $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
            echo $profile->getId();//to get the profile id
            echo $profile->getName();//to get the name of the profile
            echo $userInstance->getMobile();//to get the mobile number of the user
            echo $userInstance->getLastName();//to get the last name of the user
            echo $userInstance->getTimeZone();//to get the time zone of the user
            echo $userInstance->getZuid();//to get the zoho user id of the user
            echo $userInstance->isConfirm();//to check whether it is a confirmed user
            echo $userInstance->getFullName();//to get the full name of the user
            echo $userInstance->getPhone();//to get the phone number of the user
            echo $userInstance->getDob();//to get the date of birth of the user
            echo $userInstance->getDateFormat();//to get the date format
            echo $userInstance->getStatus();//to get the status of the user
        }
    }
}
    $obj =new Org();
    $obj->getAllActiveConfirmedAdmins();
 
Get Current User
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getCurrentUser(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        
        $response=$orgIns->getCurrentUser();//to get the current user
        $userInstance=$response->getData();//to get the user in form of ZCRMUser instance
        $userInstance=$userInstance[0];
        echo $userInstance->getId();//to get the user id
        echo $userInstance->getCountry();//to get the country of the user
        $roleInstance=$userInstance->getRole();//to get the role of the user in form of ZCRMRole instance
        echo $roleInstance->getId();//to get the role id
        echo $roleInstance->getName();//to get the role name
        $customizeInstance=$userInstance->getCustomizeInfo();//to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
        if($customizeInstance!=null)
        {
            echo $customizeInstance->getNotesDesc();//to get the note description
            echo $customizeInstance->getUnpinRecentItem();//to get the unpinned recent items
            echo $customizeInstance->isToShowRightPanel();//to check whether the right panel is shown
            echo $customizeInstance->isBcView();//to check whether the business card view is enabled
            echo $customizeInstance->isToShowHome();//to check whether the home is shown
            echo $customizeInstance->isToShowDetailView();//to check whether the detail view is shows
        }
        echo $userInstance->getCity();//to get the city of the user
        echo $userInstance->getSignature();//to get the signature of the user
        echo $userInstance->getNameFormat();// to get the name format of the user
        echo $userInstance->getLanguage();//to get the language of the user
        echo $userInstance->getLocale();//to get the locale of the user
        echo $userInstance->isPersonalAccount();//to check whther this is a personal account
        echo $userInstance->getDefaultTabGroup();//to get the default tab group
        echo $userInstance->getAlias();//to get the alias of the user
        echo $userInstance->getStreet();//to get the street name of the user
        $themeInstance=$userInstance->getTheme();//to get the theme of the user in form of the ZCRMUserTheme
        if($themeInstance!=null)
        {
            echo $themeInstance->getNormalTabFontColor();//to get the normal tab font color
            echo $themeInstance->getNormalTabBackground();//to get the normal tab background
            echo $themeInstance->getSelectedTabFontColor();//to get the selected tab font color
            echo $themeInstance->getSelectedTabBackground();//to get the selected tab background
        }
        echo $userInstance->getState();//to get the state of the user
        echo $userInstance->getCountryLocale();//to get the country locale of the user
        echo $userInstance->getFax();//to get the fax number of the user
        echo $userInstance->getFirstName();//to get the first name of the user
        echo $userInstance->getEmail();//to get the email id of the user
        echo $userInstance->getZip();//to get the zip code of the user
        echo $userInstance->getDecimalSeparator();//to get the decimal separator
        echo $userInstance->getWebsite();//to get the website of the user
        echo $userInstance->getTimeFormat();//to get the time format of the user
        $profile= $userInstance->getProfile();//to get the user's profile in form of ZCRMProfile
        echo $profile->getId();//to get the profile id
        echo $profile->getName();//to get the name of the profile
        echo $userInstance->getMobile();//to get the mobile number of the user
        echo $userInstance->getLastName();//to get the last name of the user
        echo $userInstance->getTimeZone();//to get the time zone of the user
        echo $userInstance->getZuid();//to get the zoho user id of the user
        echo $userInstance->isConfirm();//to check whether it is a confirmed user
        echo $userInstance->getFullName();//to get the full name of the user
        echo $userInstance->getPhone();//to get the phone number of the user
        echo $userInstance->getDob();//to get the date of birth of the user
        echo $userInstance->getDateFormat();//to get the date format
        echo $userInstance->getStatus();//to get the status of the user
    }
}
    $obj =new Org();
    $obj->getCurrentUser();
 
Delete User
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function deleteUser(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
       
        $responseIns=$orgIns->deleteUser("{user_id}");//to delete the user
        echo "HTTP Status Code:".$responseIns->getHttpStatusCode(); //To get http response code
        echo "Status:".$responseIns->getStatus(); //To get response status
        echo "Message:".$responseIns->getMessage(); //To get response message
        echo "Code:".$responseIns->getCode(); //To get status code
        echo "Details:".json_encode($responseIns->getDetails());
    }
}
    $obj =new Org();
    $obj->deleteUser();
 
Create User
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
use zcrmsdk\crm\setup\users\ZCRMProfile;
use zcrmsdk\crm\setup\users\ZCRMRole;
use zcrmsdk\crm\setup\users\ZCRMUser;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function createUser(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
       
        $user=ZCRMUser::getInstance(NULL, NULL);//to get the user instance
        $user->setLastName("subject");//to set the last name of the user
        $user->setFirstName("test");//to set the first name of the user
        $user->setEmail("test1@gmail.com");//to set the email id of the user
        $role=ZCRMRole::getInstance("{role_id}","{role_name}");//to get the role
        $user->setRole($role);//to get the role of the user
        $profile=ZCRMProfile::getInstance("{profile_id}","{profile_name}");//to get the profile
        $user->setProfile($profile);//to set the profile of the user
        $responseIns=$orgIns->createUser($user);//to create the user
        echo "HTTP Status Code:".$responseIns->getHttpStatusCode(); //To get http response code
        echo "Status:".$responseIns->getStatus(); //To get response status
        echo "Message:".$responseIns->getMessage(); //To get response message
        echo "Code:".$responseIns->getCode(); //To get status code
        echo "Details:".json_encode($responseIns->getDetails());
    }
}
    $obj =new Org();
    $obj->createUser();
 
Update User
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
use zcrmsdk\crm\setup\users\ZCRMProfile;
use zcrmsdk\crm\setup\users\ZCRMRole;
use zcrmsdk\crm\setup\users\ZCRMUser;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function updateUser(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $user=ZCRMUser::getInstance("{user_id}", "{user_name}");//to get the user instance
        $user->setId("{user_id}");//to set the id of the user
        $user->setFax("321432423423");//to set the fax number of the user
        $user->setMobile("4234234232");//to set the mobile number of the user
        $user->setPhone("2342342342");//to set the phone number of the user
        $user->setStreet("sddsfdsfd");//to set the street name of the user
        $user->setAlias("test");//to set the alias of the user
        $user->setWebsite("www.zoho.com");//to set the website of the user
        $user->setCity("chennai");//to set the city of the user
        $user->setCountry("India");//to set the country of the user
        $user->setState("Tamil nadu");//to set the state of the user
        $user->setZip("6000010");//to set the zip code of the user
        $responseIns=$orgIns->updateUser($user);//to update the user
        echo "HTTP Status Code:".$responseIns->getHttpStatusCode(); //To get http response code
        echo "Status:".$responseIns->getStatus(); //To get response status
        echo "Message:".$responseIns->getMessage(); //To get response message
        echo "Code:".$responseIns->getCode(); //To get status code
        echo "Details:".json_encode($responseIns->getDetails());
    }
}
    $obj =new Org();
    $obj->updateUser();
 
Profiles
Get All Profiles
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllProfiles(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $response=$orgIns->getAllProfiles();//to get the profiles
        $profiles=$response->getData();//to get the profiles in form of array of ZCRMProfile
        foreach ($profiles as $profile){
            echo $profile->getId();//to get the id of the profile
            echo $profile->getName();//to get the name of the profile
            echo $profile->isDefaultProfile();//to check whether the profile is default
            echo $profile->getCreatedTime();//to get the created time of the profile
            echo $profile->getModifiedTime();//to get the modified time of the profile
            $userInstance=$profile->getModifiedBy();//to get the user who modified the profile
            if($userInstance!=NULL){
                echo $userInstance->getId();//to get the user id
                echo $userInstance->getName();//to get the user name
            }
            echo $profile->getDescription();//to get the profile description
            $userInstance=$profile->getCreatedBy();//to get the user who created the profile
            if($userInstance!=NULL){
                echo $userInstance->getId();//to get the profile id
                echo $userInstance->getName();//to get the profile name
            }
            echo $profile->getCategory();//to get the category of the profile
            $permissions=$profile->getPermissionList();//to get the permissions of the profile
            foreach ($permissions as $permission){
                echo $permission->getDisplayLabel();//to get the display labnel of the permission
                echo $permission->getModule();//to get the module name of the permission
                echo $permission->getId();//to get the id of the permission
                echo $permission->getName();//to get the name of the permission
                echo $permission->isEnabled();//to check whether the permission is enabled
            }
            $sections=$profile->getSectionsList();//to get the section list of the profile
            foreach($sections as $section){
                echo $section->getName();//to get the name of the section
                $profilecategories=$section->getCategories();//to get the categories of the profile sections
                foreach ($profilecategories as $profilecategory){
                    echo $profilecategory->getName();//to get the name of the category
                    echo $profilecategory->getModule();//to get the module name to which the category belongs
                    echo $profilecategory->getDisplayLabel();//to get the display label of the category
                    $permissionIds= $profilecategory->getPermissionIds();//to get the permission ids of the profile section categories
                    foreach ($permissionIds as $permissionId){
                        echo $permissionId;//to get the permission id
                    }
                }
            }
        }
    }
}
    $obj =new Org();
    $obj->getAllProfiles();
 
Get Profile Data
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getProfile(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $response=$orgIns->getProfile("{profile_id}");//to get the profile
        $profile=$response->getData();//to get the profile in form of the ZCRMProfile instance
        echo $profile->getId();//to get the id of the profile
        echo $profile->getName();//to get the name of the profile
        echo $profile->isDefaultProfile();//to check whether the profile is default
        echo $profile->getCreatedTime();//to get the created time of the profile
        echo $profile->getModifiedTime();//to get the modified time of the profile
        $userInstance=$profile->getModifiedBy();//to get the user who modified the profile
        if($userInstance!=NULL){
            echo $userInstance->getId();//to get the user id
            echo $userInstance->getName();//to get the user name
        }
        echo $profile->getDescription();//to get the profile description
        $userInstance=$profile->getCreatedBy();//to get the user who created the profile
        if($userInstance!=NULL){
            echo $userInstance->getId();//to get the profile id
            echo $userInstance->getName();//to get the profile name
        }
        echo $profile->getCategory();//to get the category of the profile
        $permissions=$profile->getPermissionList();//to get the permissions of the profile
        foreach ($permissions as $permission){
            echo $permission->getDisplayLabel();//to get the display labnel of the permission
            echo $permission->getModule();//to get the module name of the permission
            echo $permission->getId();//to get the id of the permission
            echo $permission->getName();//to get the name of the permission
            echo $permission->isEnabled();//to check whether the permission is enabled
        }
        $sections=$profile->getSectionsList();//to get the section list of the profile
        foreach($sections as $section){
            echo $section->getName();//to get the name of the section
            $profilecategories=$section->getCategories();//to get the categories of the profile sections
            foreach ($profilecategories as $profilecategory){
                echo $profilecategory->getName();//to get the name of the category
                echo $profilecategory->getModule();//to get the module name to which the category belongs
                echo $profilecategory->getDisplayLabel();//to get the display label of the category
                $permissionIds= $profilecategory->getPermissionIds();//to get the permission ids of the profile section categories
                foreach ($permissionIds as $permissionId){
                    echo $permissionId;//to get the permission id
                }
            }
        }
    }
}
    $obj =new Org();
    $obj->getProfile();
 
Roles
Get All Roles
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
   {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getAllRoles(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $response=$orgIns->getAllRoles();//to get the roles of the organization
        $roles=$response->getData();//to get the roles in form of array of ZCRMRole instances
        foreach ($roles as $role){
            echo $role->getName();//to get the role name
            echo $role->getId();//to get the role id
            $reportingrole= $role->getReportingTo();//to get the role id and name to whom user of this role will report to
            if($reportingrole!=null){
                echo $reportingrole->getId();
                echo $reportingrole->getName();
            }
            echo $role->getDisplayLabel();//to get the display label of the role
            echo $role->isAdminRole();//to check whether it is the administrator role
        }
    }
}
    $obj =new Org();
    $obj->getAllRoles();
 
Get Role Data
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
      {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getRole(){
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $response=$orgIns->getRole("{role_id}");//to get the role of the organization
        $role=$response->getData();//to get the role in form ZCRMRole instance
        echo $role->getName();//to get the role name
        echo $role->getId();//to get the role id
        $reportingrole= $role->getReportingTo();//to get the role id and name to whom user of this role will report to
        if($reportingrole!=null){
            echo $reportingrole->getId();
            echo $reportingrole->getName();
        }
        echo $role->getDisplayLabel();//to get the display label of the role
        echo $role->isAdminRole();//to check whether it is the administrator role
    }
}
    $obj =new Org();
    $obj->getRole();
 
Org Taxes
Get Org Taxes
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getorgtaxes()
    {
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $orgTaxes = $orgIns->getOrganizationTaxes()->getData();
        foreach ($orgTaxes as $orgTax) {
            echo $orgTax->getId() . "\n";
            echo $orgTax->getName() . "\n";
            echo $orgTax->getDisplayName() . "\n";
            echo $orgTax->getValue() . "\n";
        }
    }
}
    $obj =new Org();
    $obj->getorgtaxes();
 
Get Org Tax Data
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function getOrganizationTax()
    {
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $orgTax = $orgIns->getOrganizationTax("{organization_tax_id}")->getData();
        echo $orgTax->getId() . "\n";
        echo $orgTax->getName() . "\n";
        echo $orgTax->getDisplayName() . "\n";
        echo $orgTax->getValue() . "\n";
    }
}
    $obj =new Org();
    $obj->getOrganizationTax();
 
Create Org Tax
          
          
<?php
use zcrmsdk\crm\crud\ZCRMOrgTax;
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function createOrganizationTaxes()
    {
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $orgTax = ZCRMOrgTax::getInstance("fsdf", NULL);
        $orgTax->setValue("34");
        $orgTaxInstances = array();
        array_push($orgTaxInstances, $orgTax);
        $responseIns = $orgIns->createOrganizationTaxes($orgTaxInstances);
        foreach ($responseIns->getEntityResponses() as $responseIn) {
            echo "HTTP Status Code:" . $responseIns->getHttpStatusCode(); // To get http response code
            echo "Status:" . $responseIn->getStatus(); // To get response status
            echo "Message:" . $responseIn->getMessage(); // To get response message
            echo "Code:" . $responseIn->getCode(); // To get status code
            echo "Details:" . json_encode($responseIn->getDetails());
        }
    }
}
    $obj =new Org();
    $obj->createOrganizationTaxes();
 
Update Org Tax
          
          
<?php
use zcrmsdk\crm\crud\ZCRMOrgTax;
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function updateOrganizationTaxes()
    {
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $orgTax = ZCRMOrgTax::getInstance("Salesax","{org_tax_id}");
        $orgTax->setValue("33");
        $orgTaxInstances = array();
        array_push($orgTaxInstances, $orgTax);
        $responseIns = $orgIns->updateOrganizationTaxes($orgTaxInstances);
        foreach ($responseIns->getEntityResponses() as $responseIn) {
            echo "HTTP Status Code:" . $responseIns->getHttpStatusCode(); // To get http response code
            echo "Status:" . $responseIn->getStatus(); // To get response status
            echo "Message:" . $responseIn->getMessage(); // To get response message
            echo "Code:" . $responseIn->getCode(); // To get status code
            echo "Details:" . json_encode($responseIn->getDetails());
        }
    }
}
    $obj =new Org();
    $obj->updateOrganizationTaxes();
 
Delete Org Tax
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function deleteOrganizationTax()
    {
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $responseIn = $orgIns->deleteOrganizationTax("{org_tax_id}");
        echo "HTTP Status Code:" . $responseIn->getHttpStatusCode(); // To get http response code
        echo "Status:" . $responseIn->getStatus(); // To get response status
        echo "Message:" . $responseIn->getMessage(); // To get response message
        echo "Code:" . $responseIn->getCode(); // To get status code
        echo "Details:" . json_encode($responseIn->getDetails());
    }
}
    $obj =new Org();
    $obj->deleteOrganizationTax();
 
Delete Org Taxes
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
    }
    public function deleteOrganizationTaxes()
    {
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        $responseIns = $orgIns->deleteOrganizationTaxes($orgTaxids);
        foreach ($responseIns->getEntityResponses() as $responseIn) {
            echo "HTTP Status Code:" . $responseIns->getHttpStatusCode(); // To get http response code
            echo "Status:" . $responseIn->getStatus(); // To get response status
            echo "Message:" . $responseIn->getMessage(); // To get response message
            echo "Code:" . $responseIn->getCode(); // To get status code
            echo "Details:" . json_encode($responseIn->getDetails());
        }
    }
}
    $obj =new Org();
    $obj->deleteOrganizationTaxes();
 
Search Users (by criteria)
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
require 'vendor/autoload.php';
class Org{
    public function __construct()
    {
         $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
         ZCRMRestClient::initialize($configuration);
    }
    public function searchUsersByCriteria()
    {
        $orgIns = ZCRMRestClient::getOrganizationInstance(); // to get the organization instance
        /* For VERSION <=2.0.6 $userInstances = $orgIns->searchUsersByCriteria("{criteria}", "{type}")->getData(); // to get the users of the organization based on criteria and type of the user(active,deleted,etc)*/
         $param_map=array("page"=>"1","per_page"=>"200"); // key-value pair containing all the parameters - optional
        $userInstances = $orgIns->searchUsersByCriteria("{criteria}", $param_map)->getData(); // to get the users of the organization based on criteria 
        foreach ($userInstances as $userInstance) {
            echo $userInstance->getId(); // to get the user id
            echo $userInstance->getCountry(); // to get the country of the user
            $roleInstance = $userInstance->getRole(); // to get the role of the user in form of ZCRMRole instance
            echo $roleInstance->getId(); // to get the role id
            
            
            echo $roleInstance->getName(); // to get the role name
            $customizeInstance = $userInstance->getCustomizeInfo(); // to get the customization information of the user in for of the ZCRMUserCustomizeInfo form
            if ($customizeInstance != null) {
                echo $customizeInstance->getNotesDesc(); // to get the note description
                echo $customizeInstance->getUnpinRecentItem(); // to get the unpinned recent items
                echo $customizeInstance->isToShowRightPanel(); // to check whether the right panel is shown
                echo $customizeInstance->isBcView(); // to check whether the business card view is enabled
                echo $customizeInstance->isToShowHome(); // to check whether the home is shown
                echo $customizeInstance->isToShowDetailView(); // to check whether the detail view is shows
            }
            echo $userInstance->getCity(); // to get the city of the user
            echo $userInstance->getSignature(); // to get the signature of the user
            echo $userInstance->getNameFormat(); // to get the name format of the user
            echo $userInstance->getLanguage(); // to get the language of the user
            echo $userInstance->getLocale(); // to get the locale of the user
            echo $userInstance->isPersonalAccount(); // to check whther this is a personal account
            echo $userInstance->getDefaultTabGroup(); // to get the default tab group
            echo $userInstance->getAlias(); // to get the alias of the user
            echo $userInstance->getStreet(); // to get the street name of the user
            $themeInstance = $userInstance->getTheme(); // to get the theme of the user in form of the ZCRMUserTheme
            if ($themeInstance != null) {
                echo $themeInstance->getNormalTabFontColor(); // to get the normal tab font color
                echo $themeInstance->getNormalTabBackground(); // to get the normal tab background
                echo $themeInstance->getSelectedTabFontColor(); // to get the selected tab font color
                echo $themeInstance->getSelectedTabBackground(); // to get the selected tab background
            }
            echo $userInstance->getState(); // to get the state of the user
            echo $userInstance->getCountryLocale(); // to get the country locale of the user
            echo $userInstance->getFax(); // to get the fax number of the user
            echo $userInstance->getFirstName(); // to get the first name of the user
            echo $userInstance->getEmail(); // to get the email id of the user
            echo $userInstance->getZip(); // to get the zip code of the user
            echo $userInstance->getDecimalSeparator(); // to get the decimal separator
            echo $userInstance->getWebsite(); // to get the website of the user
            echo $userInstance->getTimeFormat(); // to get the time format of the user
            $profile = $userInstance->getProfile(); // to get the user's profile in form of ZCRMProfile
            echo $profile->getId(); // to get the profile id
            echo $profile->getName(); // to get the name of the profile
            echo $userInstance->getMobile(); // to get the mobile number of the user
            echo $userInstance->getLastName(); // to get the last name of the user
            echo $userInstance->getTimeZone(); // to get the time zone of the user
            echo $userInstance->getZuid(); // to get the zoho user id of the user
            echo $userInstance->isConfirm(); // to check whether it is a confirmed user
            echo $userInstance->getFullName(); // to get the full name of the user
            echo $userInstance->getPhone(); // to get the phone number of the user
            echo $userInstance->getDob(); // to get the date of birth of the user
            echo $userInstance->getDateFormat(); // to get the date format
            echo $userInstance->getStatus(); // to get the status of the user
        }
    }
}
    $obj =new Org();
    $obj->searchUsersByCriteria();
 
Get Notes
          
          
<?php
    use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
    require 'vendor/autoload.php';
    class Org{
        public function __construct()
        {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
        }
        
public function getNotes()
    {
        $org = ZCRMOrganization::getInstance();
        /* For VERSION <=2.0.6  $notes = $org->getNotes()->getData(); // to get the notes in form of ZCRMNote instances array */
        $param_map=array("page"=>"20","per_page"=>"200"); // key-value pair containing all the parameters - optional
    $header_map = array("if-modified-since"=>"2019-11-10T15:26:49+05:30"); // key-value pair containing all the headers - optional
    $response = $orgIns->getNotes($param_map,$header_map); // to get all the notes
        foreach ($notes as $note) { 
            echo "\n";
            echo $note->getParentModule();
            echo $note->getId(); // To get note id
            echo $note->getTitle(); // To get note title
            echo $note->getContent(); // To get note content
            $parentRecord = $note->getParentRecord(); // To get note's parent record
            echo $parentRecord->getEntityId(); // To get note's parent record id
            echo $note->getParentName(); // To get note's parent name
            echo $note->getParentId(); // To get note's parent id
            $createdBy = $note->getCreatedBy();
            echo $createdBy->getId(); // To get user_id who created the note
            echo $createdBy->getName(); // To get user name who created the note
            $modifiedBy = $note->getModifiedBy();
            echo $modifiedBy->getId(); // To get user_id who modified the note
            echo $modifiedBy->getName(); // To get user name who modified the note
            $owner = $note->getOwner();
            echo $owner->getId(); // To get note_record owner id
            echo $owner->getName(); // To get note_record Owner name
            echo $note->getCreatedTime(); // To get created time of the note
            echo $note->getModifiedTime(); // To get modified time of the note
            echo $note->isVoiceNote(); // Check if the note is voice_note or not
            echo $note->getSize(); // To get note_record size
            $attchments = $note->getAttachments(); // To get attachments of the note_record
            if ($attchments != null) // check If attachments is empty/not
            {
                foreach ($attchments as $attchmentIns) {
                    echo $attchmentIns->getId(); // To get the note's attachment id
                    echo $attchmentIns->getFileName(); // To get the note's attachment file name
                    echo $attchmentIns->getFileType(); // To get the note's attachment file type
                    echo $attchmentIns->getSize(); // To get the note's attachment file size
                    echo $attchmentIns->getParentModule(); // To get the note's attachment parent module name
                    $parentRecord = $attchmentIns->getParentRecord();
                    echo $parentRecord->getEntityId(); // To get the note's parent record id
                    echo $attchmentIns->getParentName(); // To get the note name
                    echo $attchmentIns->getParentId(); // To get the note id
                    $createdBy = $attchmentIns->getCreatedBy();
                    echo $createdBy->getId(); // To get user_id who created the note's attachment
                    echo $createdBy->getName(); // To get user name who created the note's attachment
                    $modifiedBy = $attchmentIns->getModifiedBy();
                    echo $modifiedBy->getId(); // To get user_id who modified the note's attachment
                    echo $modifiedBy->getName(); // To get user name who modified the note's attachment
                    $owner = $attchmentIns->getOwner();
                    echo $owner->getId(); // To get the note's attachment owner id
                    echo $owner->getName(); // To get the note's attachment owner name
                    echo $attchmentIns->getCreatedTime(); // To get attachment created time
                    echo $attchmentIns->getModifiedTime(); // To get attachment modified time
                }
            }
        }
    }
    }
    $obj =new Org();
    $obj->getNotes();
 
Create Notes
          
          
<?php
    use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
    require 'vendor/autoload.php';
    class Org{
        public function __construct()
        {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
        }
        
public function createNotes(){
        $org = ZCRMOrganization::getInstance();
        $record = ZCRMRecord::getInstance("Products", "3524033000003352001");
        $noteIns = ZCRMNote::getInstance($record, NULL); // to get the note instance
        $noteIns->setTitle("Title_API1"); // to set the note title
        $noteIns->setContent("This is test content"); // to set the note content
        $noteIns1 = ZCRMNote::getInstance($record, NULL); // to get another note instance
        $noteIns1->setTitle("Title_API1"); // to set the note title
        $noteIns1->setContent("This is test content");
        $noteInstances=[$noteIns,$noteIns1];
        $responseIn=$org->createNotes($noteInstances);
        foreach ($responseIn->getEntityResponses() as $responseIns) {
            echo "HTTP Status Code:" . $responseIn->getHttpStatusCode(); // To get http response code
            echo "Status:" . $responseIns->getStatus(); // To get response status
            echo "Message:" . $responseIns->getMessage(); // To get response message
            echo "Code:" . $responseIns->getCode(); // To get status code
            echo "Details:" . json_encode($responseIns->getDetails());
        }
    }
    }
    $obj =new Org();
    $obj->createNotes();
 
Delete Notes
          
          
<php
    use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
    require 'vendor/autoload.php';
    class Org{
        public function __construct()
        {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
        }
        
public function deleteNotes(){
        $org = ZCRMOrganization::getInstance();
        $noteIds=["3524033000003392002","3524033000003392001"];
        $responseIn=$org->deleteNotes($noteIds);
        foreach ($responseIn->getEntityResponses() as $responseIns) {
            echo "HTTP Status Code:" . $responseIn->getHttpStatusCode(); // To get http response code
            echo "Status:" . $responseIns->getStatus(); // To get response status
            echo "Message:" . $responseIns->getMessage(); // To get response message
            echo "Code:" . $responseIns->getCode(); // To get status code
            echo "Details:" . json_encode($responseIns->getDetails());
        }
    }
    }
    $obj =new Org();
    $obj->deleteNotes();
 
Get Variables
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
use zcrmsdk\crm\setup\org\ZCRMOrganization;
use zcrmsdk\crm\crud\ZCRMVariable;
use zcrmsdk\crm\crud\ZCRMVariableGroup;
require 'vendor/autoload.php';
class Org {
    public function __construct() {
        $configuration = array("client_id" => {client_id}, "client_secret" => {client_secret}, "redirect_uri" => {redirect_url}, "currentUserEmail"=>{user_email_id});
        ZCRMRestClient::initialize($configuration);
    }
    public static function getVariables() {
        $org_ins = ZCRMOrganization::getInstance();
        $variable_instances = $org_ins->getVariables()->getData();
        foreach ($variable_instances as $variable_instance) {
            echo $variable_instance->getId();
            echo $variable_instance->getName();
            echo $variable_instance->getApiName();
            echo $variable_instance->getType();
            echo $variable_instance->getValue();
            foreach ($variable_instance->getVariableGroup() as $variable_group) {
                echo $variable_group->getId();
                echo $variable_group->getName();
            }
            echo $variable_instance->getDescription();
        }
    }
}
$obj = new Org();
$obj->getVariables();
Create Variables
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
use zcrmsdk\crm\setup\org\ZCRMOrganization;
use zcrmsdk\crm\crud\ZCRMVariable;
use zcrmsdk\crm\crud\ZCRMVariableGroup;
    require 'vendor/autoload.php';
    class Org{
        public function __construct()
        {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
        }
    public static function createVariables(){
        $variable_array =array() ;
        $org_ins=ZCRMOrganization::getInstance();
        $variable_ins=ZCRMVariable::getInstance();//to get the rest client
        $variable_ins->setName("v");
        $variable_ins->setType("integer");
        $variable_ins->setValue("2");
        $variable_group = ZCRMVariableGroup::getInstance();
        $variable_group->setId("3524033000000231001");
        $variable_group->setApiName("General");
        $variable_ins->setVariableGroup($variable_group);
        $variable_ins->setDescription("automated sdk");
        array_push($variable_array,$variable_ins);
        $variable_ins1=ZCRMVariable::getInstance();//to get the rest client
        $variable_ins1->setName("v");
        $variable_ins1->setType("integer");
        $variable_ins1->setValue("2");
        $variable_group = ZCRMVariableGroup::getInstance();
        $variable_group->setId("3524033000000231001");
        $variable_group->setApiName("General");
        $variable_ins1->setVariableGroup($variable_group);
        $variable_ins1->setDescription("automated sdk");
        array_push($variable_array,$variable_ins1);
        $responseIn=$org_ins->createVariables($variable_array);
        foreach ($responseIn->getEntityResponses() as $responseIns) {
            echo "HTTP Status Code:" . $responseIn->getHttpStatusCode(); // To get http response code
            echo "Status:" . $responseIns->getStatus(); // To get response status
            echo "Message:" . $responseIns->getMessage(); // To get response message
            echo "Code:" . $responseIns->getCode(); // To get status code
            echo "Details:" . json_encode($responseIns->getDetails());
        } 
    }
}
$obj =new Org();
$obj->createVariables();
Update Variables
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
use zcrmsdk\crm\setup\org\ZCRMOrganization;
use zcrmsdk\crm\crud\ZCRMVariable;
use zcrmsdk\crm\crud\ZCRMVariableGroup;
    require 'vendor/autoload.php';
    class Org{
        public function __construct()
        {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
        }
 public static function updateVariables(){
        $variable_array =array() ;
        $org_ins=ZCRMOrganization::getInstance();
        $variable_ins=ZCRMVariable::getInstance();//to get the rest client
        $variable_ins->setId("3524033000002999002");
        $variable_ins->setName("x");
        $variable_ins->setType("integer");
        $variable_ins->setValue("2");
        $variable_group = ZCRMVariableGroup::getInstance();
        $variable_group->setId("3524033000000231001");
        $variable_group->setApiName("General");
        $variable_ins->setVariableGroup($variable_group);
        $variable_ins->setDescription("automated sdk");
        array_push($variable_array,$variable_ins);
        $variable_ins1=ZCRMVariable::getInstance();//to get the rest client
        $variable_ins1->setName("y");
        $variable_ins1->setId("3524033000003000001");
        $variable_ins1->setType("integer");
        $variable_ins1->setValue("2");
        $variable_group = ZCRMVariableGroup::getInstance();
        $variable_group->setId("3524033000000231001");
        $variable_group->setApiName("General");
        $variable_ins1->setVariableGroup($variable_group);
        $variable_ins1->setDescription("automated sdk");
        array_push($variable_array,$variable_ins1);
        $responseIn=$org_ins->updateVariables($variable_array);
        foreach ($responseIn->getEntityResponses() as $responseIns) {
            echo "HTTP Status Code:" . $responseIn->getHttpStatusCode(); // To get http response code
            echo "Status:" . $responseIns->getStatus(); // To get response status
            echo "Message:" . $responseIns->getMessage(); // To get response message
            echo "Code:" . $responseIns->getCode(); // To get status code
            echo "Details:" . json_encode($responseIns->getDetails());
        }
    }
}
$obj =new Org();
$obj->updateVariables();
Get Variable Groups
          
          
<?php
use zcrmsdk\crm\setup\restclient\ZCRMRestClient;
use zcrmsdk\crm\setup\org\ZCRMOrganization;
use zcrmsdk\crm\crud\ZCRMVariable;
use zcrmsdk\crm\crud\ZCRMVariableGroup;
    require 'vendor/autoload.php';
    class Org{
        public function __construct()
        {
            $configuration = array("client_id"=>{client_id},"client_secret"=>{client_secret},"redirect_uri"=>{redirect_url},"currentUserEmail"=>{user_email_id});
            ZCRMRestClient::initialize($configuration);
        }
 public static function getVariableGroups(){
        $org_ins=ZCRMOrganization::getInstance();//to get the rest client
        $variable_group_instances = $org_ins->getVariableGroups()->getData();
        foreach($variable_group_instances as $variable_group_instance ){
            echo $variable_group_instance->getId();
            echo $variable_group_instance->getName();
            echo $variable_group_instance->getApiName();
            echo $variable_group_instance->getDisplayLabel();
            echo $variable_group_instance->getDescription();
        }
    }
}
$obj =new Org();
$obj->getVariableGroups();