Users APIs

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

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

Get Users

Purpose

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

Request Details

Request URL

https://www.zohoapis.com/crm/v2/users

To get a specific user:
https://www.zohoapis.com/crm/v2/users/{user_id}

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

If-Modified-Since: Use this header to get the list of recently modified users. Example: 2019-07-25T15:26:49+05:30

Scope

scope=ZohoCRM.users.{operation_type}

Possible operation types

ALL - Full access to users
READ - Get user data

Parameters
  • typestring, optional

    Specify the type of the users you want to retrieve.

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

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

  • per_pageinteger, optional

    To set the number of user records to be retrieved per page. The default and the maximum possible value is 200.

  • idsstring, optional

    Represents the unique ID of the users. You can specify up to 100 user IDs.

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

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v2/users?type=AllUsers"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
3.0.08.0
Copied//Get instance of UsersOperations Class
UsersOperations usersOperations = new UsersOperations();

//Get instance of ParameterMap Class
ParameterMap paramInstance = new ParameterMap();

paramInstance.add(GetUsersParam.TYPE, "ActiveUsers");

paramInstance.add(GetUsersParam.PAGE, 1);

//paramInstance.add(GetUsersParam.PER_PAGE, 1);

HeaderMap headerInstance = new HeaderMap();

OffsetDateTime ifmodifiedsince = OffsetDateTime.of(2020, 01, 02, 10, 00, 01, 00, ZoneOffset.of("+05:30"));

headerInstance.add(GetUsersHeader.IF_MODIFIED_SINCE, ifmodifiedsince);

//Call getUsers method that takes paramInstance and headerInstance as parameters
APIResponse < ResponseHandler > response = usersOperations.getUsers(paramInstance, headerInstance);
Copiedpackage com.zoho.crm.api.sample.restapi.users;
import javax.net.ssl.SSLContext;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
public class UsersAPIs 
{
	private static void getUsers()
	{
		try
		{
			HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
			SSLContext sslContext = SSLContext.getDefault();
			SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE);
			CloseableHttpClient httpclient = httpClientBuilder.setSSLSocketFactory(sslConnectionSocketFactory).build();
			URIBuilder uriBuilder = new URIBuilder("https://www.zohoapis.com/crm/v2/users");
			uriBuilder.addParameter("type", "AllUsers");
			uriBuilder.addParameter("page", "1");
			uriBuilder.addParameter("per_page", "2");
			HttpUriRequest requestObj = new HttpGet(uriBuilder.build());
			requestObj.addHeader("Authorization", "Zoho-oauthtoken 1000.xxxxxxx.xxxxxxx");
			requestObj.addHeader("If-Modified-Since", "2020-05-15T12:00:00+05:30");
			HttpResponse response = httpclient.execute(requestObj);
			HttpEntity responseEntity = response.getEntity();
			System.out.println("HTTP Status Code : " + response.getStatusLine().getStatusCode());
			if(responseEntity != null)
			{
				Object responseObject = EntityUtils.toString(responseEntity);
				String responseString = responseObject.toString();
				System.out.println(responseString);
			}
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
	}
	private static void getUser()
	{
		try
		{
			HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
			SSLContext sslContext = SSLContext.getDefault();
			SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE);
			CloseableHttpClient httpclient = httpClientBuilder.setSSLSocketFactory(sslConnectionSocketFactory).build();
			URIBuilder uriBuilder = new URIBuilder("https://www.zohoapis.com/crm/v2/users/34770615695004");
			HttpUriRequest requestObj = new HttpGet(uriBuilder.build());
			requestObj.addHeader("Authorization", "Zoho-oauthtoken 1000.xxxxxxx.xxxxxxx");
			requestObj.addHeader("If-Modified-Since", "2020-05-15T12:00:00+05:30");
			HttpResponse response = httpclient.execute(requestObj);
			HttpEntity responseEntity = response.getEntity();
			System.out.println("HTTP Status Code : " + response.getStatusLine().getStatusCode());
			if(responseEntity != null)
			{
				Object responseObject = EntityUtils.toString(responseEntity);
				String responseString = responseObject.toString();
				System.out.println(responseString);
			}
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
	}
	public static void main(String[] args) 
	{
		getUsers();
		getUser();
	}
}
3.0.07.x
Copied//Get instance of UsersOperations Class
$usersOperations = new UsersOperations();		
//Get instance of ParameterMap Class
$paramInstance = new ParameterMap();		
$paramInstance->add(GetUsersParam::type(), "ActiveUsers");		
$paramInstance->add(GetUsersParam::page(), 1);
$paramInstance->add(GetUsersParam::perPage(), 1);		
$headerInstance = new HeaderMap();
$ifmodifiedsince = date_create("2020-07-15T17:58:47+05:30")->setTimezone(new \DateTimeZone(date_default_timezone_get()));		
$headerInstance->add(GetUsersHeader::IfModifiedSince(), $ifmodifiedsince);
//Call getUsers method that takes paramInstance as parameter
$response = $usersOperations->getUsers($paramInstance, $headerInstance);
Copied<?php
class GetUsers{
    
    public function execute(){
        $curl_pointer = curl_init();
        
        $curl_options = array();
        $url = "https://www.zohoapis.com/crm/v2/users?";
        $parameters = array();
        $parameters["type"]="AllUsers";
        $parameters["page"]="1";
        $parameters["per_page"]="2";
        foreach ($parameters as $key=>$value){
            $url =$url.$key."=".$value."&";
        }
        $curl_options[CURLOPT_URL] = $url;
        $curl_options[CURLOPT_RETURNTRANSFER] = true;
        $curl_options[CURLOPT_HEADER] = 1;
        $curl_options[CURLOPT_CUSTOMREQUEST] = "GET";
        $headersArray = array();
        
        $headersArray[] = "Authorization". ":" . "Zoho-oauthtoken " . "1000.f62e4f4XXXXXXXXXXXX93.0af14cXXXXXXXXXXX27beb";
        $headersArray[] = "If-Modified-Since".":"."2020-05-15T12:00:00+05:30";
        $curl_options[CURLOPT_HTTPHEADER]=$headersArray;
        
        curl_setopt_array($curl_pointer, $curl_options);
        
        $result = curl_exec($curl_pointer);
        $responseInfo = curl_getinfo($curl_pointer);
        curl_close($curl_pointer);
        list ($headers, $content) = explode("\r\n\r\n", $result, 2);
        if(strpos($headers," 100 Continue")!==false){
            list( $headers, $content) = explode( "\r\n\r\n", $content , 2);
        }
        $headerArray = (explode("\r\n", $headers, 50));
        $headerMap = array();
        foreach ($headerArray as $key) {
            if (strpos($key, ":") != false) {
                $firstHalf = substr($key, 0, strpos($key, ":"));
                $secondHalf = substr($key, strpos($key, ":") + 1);
                $headerMap[$firstHalf] = trim($secondHalf);
            }
        }
        $jsonResponse = json_decode($content, true);
        if ($jsonResponse == null && $responseInfo['http_code'] != 204) {
            list ($headers, $content) = explode("\r\n\r\n", $content, 2);
            $jsonResponse = json_decode($content, true);
        }
        var_dump($headerMap);
        var_dump($jsonResponse);
        var_dump($responseInfo['http_code']);
        
    }
    
}
(new GetUsers())->execute();
3.0.08.x
Copied//Get instance of UsersOperations Class
UsersOperations usersOperations = new UsersOperations();
//Get instance of ParameterMap Class
ParameterMap paramInstance = new ParameterMap();
paramInstance.Add(GetUsersParam.TYPE, "ActiveUsers");
paramInstance.Add(GetUsersParam.PAGE, 1);
//paramInstance.Add(GetUsersParam.PER_PAGE, 1);
HeaderMap headerInstance = new HeaderMap();
DateTimeOffset ifmodifiedsince = new DateTimeOffset(new DateTime(2020, 05, 15, 12, 0, 0, DateTimeKind.Local));
headerInstance.Add(GetUsersHeader.IF_MODIFIED_SINCE, ifmodifiedsince);
//Call GetUsers method that takes ParameterMap instance and HeaderMap instance as parameters
APIResponse<ResponseHandler> response = usersOperations.GetUsers(paramInstance, headerInstance);
Copiedusing System;
using System.IO;
using System.Net;
using System.Xml;
using Newtonsoft.Json;
namespace Com.Zoho.Crm.API.Sample.RestAPI.Users
{
    public class UsersAPIs
    {
        public static void GetUsers()
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.zohoapis.com/crm/v2/users?type=AllUsers");
            request.Method = "GET";
            request.Headers["Authorization"] = "Zoho-oauthtoken 1000.avvfdXXXXXXXXXXXXXXsd.65fbaXXXXXXXXdafd";
            string IfModifiedSince = JsonConvert.SerializeObject("2020-05-15T12:00:00+05:30");
            IfModifiedSince = IfModifiedSince.Replace("\\", "");
            IfModifiedSince = IfModifiedSince.Replace("\"", "");
            DateTime dateConversion = XmlConvert.ToDateTime(IfModifiedSince, XmlDateTimeSerializationMode.Utc);
            request.IfModifiedSince = dateConversion;
            request.KeepAlive = true;
            HttpWebResponse response;
            try
            {
                response = (HttpWebResponse)request.GetResponse();
            }
            catch (WebException e)
            {
                if (e.Response == null) { throw; }
                response = (HttpWebResponse)e.Response;
            }
            HttpWebResponse responseEntity = response;
            Console.WriteLine("HTTP Status Code : " + (int)response.StatusCode);
            string responsestring = new StreamReader(responseEntity.GetResponseStream()).ReadToEnd();
            responseEntity.Close();
            Console.WriteLine(responsestring);
        }
        public static void GetUser()
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.zohoapis.com/crm/v2/users/34770615695004");
            request.Method = "GET";
            request.Headers["Authorization"] = "Zoho-oauthtoken 1000.axvbbXXXXXX.65fbaa8a2efa71ba7b27bd4fed4bdafd";
            string IfModifiedSince = JsonConvert.SerializeObject("2020-05-15T12:00:00+05:30");
            IfModifiedSince = IfModifiedSince.Replace("\\", "");
            IfModifiedSince = IfModifiedSince.Replace("\"", "");
            DateTime dateConversion = XmlConvert.ToDateTime(IfModifiedSince, XmlDateTimeSerializationMode.Utc);
            request.IfModifiedSince = dateConversion;
            request.KeepAlive = true;
            HttpWebResponse response;
            try
            {
                response = (HttpWebResponse)request.GetResponse();
            }
            catch (WebException e)
            {
                if (e.Response == null) { throw; }
                response = (HttpWebResponse)e.Response;
            }
            HttpWebResponse responseEntity = response;
            Console.WriteLine("HTTP Status Code : " + (int)response.StatusCode);
            string responsestring = new StreamReader(responseEntity.GetResponseStream()).ReadToEnd();
            responseEntity.Close();
            Console.WriteLine(responsestring);
        }
    }
}
3.0.03.x.x
Copied# Get instance of UsersOperations Class
users_operations = UsersOperations()
# Get instance of ParameterMap Class
param_instance = ParameterMap()
# Possible parameters for Get Users operation
param_instance.add(GetUsersParam.page, 1)
param_instance.add(GetUsersParam.per_page, 200)
param_instance.add(GetUsersParam.type, 'ActiveConfirmedUsers')
# Get instance of ParameterMap Class
header_instance = HeaderMap()
# Possible headers for Get Users operation
header_instance.add(GetUsersHeader.if_modified_since, datetime.fromisoformat('2019-07-07T10:00:00+05:30'))
# Call get_users method that takes ParameterMap instance and HeaderMap instance as parameters
response = users_operations.get_users(param_instance, header_instance)
Copieddef get_users():
    import requests

    url = 'https://www.zohoapis.com/crm/v2/users'

    headers = {
        'Authorization': 'Zoho-oauthtoken 1000.04be928e4a96XXXXXXXXXXXXX68.0b9eXXXXXXXXXXXX60396e268',
        'If-Modified-Since': '2020-05-15T12:00:00+05:30'
    }

    parameters = {
        'type': 'AllUsers',
        'page': 1,
        'per_page': 10
    }

    response = requests.get(url=url, headers=headers, params=parameters)

    if response is not None:
        print("HTTP Status Code : " + str(response.status_code))

        print(response.json())

get_users()
2.02.x.x
Copied# Get instance of UsersOperations Class
uo = Users::UsersOperations.new
# Get instance of ParameterMap Class
pm = ParameterMap.new
# Possible parameters for Get Users operation
pm.add(Users::UsersOperations::GetUsersParam.type, 'ActiveUsers')
pm.add(Users::UsersOperations::GetUsersParam.page, 1)
# Get instance of HeaderMap Class
hm = HeaderMap.new
# Possible headers for Get Users operation
# hm.add(Users::UsersOperations::GetUsersHeader.If_modified_since,"")
# Call get_users method that takes ParameterMap instance and HeaderMap instance as parameters
response = uo.get_users(pm, hm)

# Get instance of UsersOperations Class
uo = Users::UsersOperations.new
# Get instance of HeaderMap Class
hm = HeaderMap.new
# hm.add(Users::UsersOperations::GetUsersHeader.If_modified_since,"")
# Call get_user method that takes HeaderMap instance and user_id as parameters
response = uo.get_user(user_id,hm)
Copiedclass GetUsers

    def execute
        parameters ={}
        parameters["type"]="AllUsers";
        parameters["page"]="1";
        parameters["per_page"]="2";
        query_string = parameters.to_a.map { |x| "#{x[0]}=#{x[1]}" }.join('&')
        url = "https://www.zohoapis.com/crm/v2/users";
        url += '?' + query_string if !query_string.nil? && (query_string.strip != '')
        url = URI(url)
        req = Net::HTTP::Get.new(url.request_uri)
        http = Net::HTTP.new(url.host, url.port)
        http.use_ssl = true
        headers={}
        headers["Authorization"]="Zoho-oauthtoken 1000.50XXXXXXXXX&77e3a.44XXXXXXXXX8353"
        headers["If-Modified-Since"]="2020-05-15T12:00:00+05:30";
        headers&.each { |key, value| req.add_field(key, value) }
        response=http.request(req)
        status_code = response.code.to_i
        headers = response.each_header.to_h
        print status_code
        print headers
        unless response.body.nil?
            print  response.body
        end
    end
end
GetUsers.new.execute
1.0.0ES6
Copied//Get instance of UsersOperations Class
let usersOperations = new ZCRM.User.Operations();
//Get instance of ParameterMap Class
let paramInstance = new ParameterMap();
/* Possible parameters for Get Users operation */
await paramInstance.add(ZCRM.User.Model.GetUsersParam.TYPE, "ActiveUsers");
await paramInstance.add(ZCRM.User.Model.GetUsersParam.PAGE, 1);
await paramInstance.add(ZCRM.User.Model.GetUsersParam.PER_PAGE, 200);
//Get instance of HeaderMap Class
let headerInstance = new HeaderMap();
/* Possible headers for Get Users operation */
await headerInstance.add(ZCRM.User.Model.GetUsersHeader.IF_MODIFIED_SINCE, new Date("2019-07-07T10:00:00+05:30"));
//Call getUsers method that takes ParameterMap instance and HeaderMap instance as parameters
let response = await usersOperations.getUsers(paramInstance, headerInstance);
Copiedvar listener = 0;
class UsersAPIs {

	async getUsers()	{
		var url = "https://www.zohoapis.com/crm/v2/users"
        var parameters = new Map()
        var headers = new Map()
        var token = {
            clientId:"1000.NPY9M1V0XXXXXXXXXXXXXXXXXXXF7H",
            redirectUrl:"http://127.0.0.1:5500/redirect.html",
            scope:"ZohoCRM.users.ALL,ZohoCRM.bulk.read,ZohoCRM.modules.ALL,ZohoCRM.settings.ALL,Aaaserver.profile.Read,ZohoCRM.org.ALL,profile.userphoto.READ,ZohoFiles.files.ALL,ZohoCRM.bulk.ALL,ZohoCRM.settings.variable_groups.ALL"
        }
        var accesstoken = await new UsersAPIs().getToken(token)
        headers.set("Authorization", "Zoho-oauthtoken " + accesstoken)
        headers.set("If-Modified-Since", "2020-05-15T12:00:00+05:30")
        parameters.set("type", "ActiveUsers")
        parameters.set("page", "1")
        parameters.set("per_page", "2")
        var requestMethod = "GET"
        var reqBody = null
        var params = "";
        parameters.forEach(function(value, key) {
            if (parameters.has(key)) {
                if (params) {
                    params = params + key + '=' + value + '&';
                }
                else {
                    params = key + '=' + value + '&';
                }
            }
        });
        var apiHeaders = {};
        if(headers) {
            headers.forEach(function(value, key) {
                apiHeaders[key] = value;
            });
        }
        if (params.length > 0){
            url = url + '?' + params.substring(0, params.length - 1);
        }
        var requestObj = {
            uri : url,
            method : requestMethod,
            headers : apiHeaders,
            body : JSON.stringify(reqBody),
            encoding: "utf8",
            allowGetBody : true,
			throwHttpErrors : false
        };
        var result = await new UsersAPIs().makeAPICall(requestObj);
        console.log(result.status)
        console.log(result.response)
    }

	async getUser()	{
		var url = "https://www.zohoapis.com/crm/v2/users/35240336182001"
        var parameters = new Map()
        var headers = new Map()
        var token = {
            clientId:"1000.NPY9M1V0XXXXXXXXXXXXXXXXXXXF7H",
            redirectUrl:"http://127.0.0.1:5500/redirect.html",
            scope:"ZohoCRM.users.ALL,ZohoCRM.bulk.read,ZohoCRM.modules.ALL,ZohoCRM.settings.ALL,Aaaserver.profile.Read,ZohoCRM.org.ALL,profile.userphoto.READ,ZohoFiles.files.ALL,ZohoCRM.bulk.ALL,ZohoCRM.settings.variable_groups.ALL"
        }
        var accesstoken = await new UsersAPIs().getToken(token)
        headers.set("Authorization", "Zoho-oauthtoken " + accesstoken)
        headers.set("If-Modified-Since", "2019-05-15T12:00:00+05:30")
        var requestMethod = "GET"
        var reqBody = null
        var params = "";
        parameters.forEach(function(value, key) {
            if (parameters.has(key)) {
                if (params) {
                    params = params + key + '=' + value + '&';
                }
                else {
                    params = key + '=' + value + '&';
                }
            }
        });
        var apiHeaders = {};
        if(headers) {
            headers.forEach(function(value, key) {
                apiHeaders[key] = value;
            });
        }
        if (params.length > 0){
            url = url + '?' + params.substring(0, params.length - 1);
        }
        var requestObj = {
            uri : url,
            method : requestMethod,
            headers : apiHeaders,
            body : JSON.stringify(reqBody),
            encoding: "utf8",
            allowGetBody : true,
			throwHttpErrors : false
        };
        var result = await new UsersAPIs().makeAPICall(requestObj);
        console.log(result.status)
        console.log(result.response)
	}

    async getToken(token) {

        if(listener == 0) {

            window.addEventListener("storage", function(reponse) {
                if(reponse.key === "access_token" && (reponse.oldValue != reponse.newValue || reponse.oldValue == null)){
                    location.reload();
                }
                if(reponse.key === "access_token"){

                    sessionStorage.removeItem("__auth_process");
                }
            }, false);
            listener = 1;
            if(sessionStorage.getItem("__auth_process")) {
                sessionStorage.removeItem("__auth_process");
            }
        }
        ["granted_for_session", "access_token","expires_in","expires_in_sec","location","api_domain","state","__token_init","__auth_process"].forEach(function (k) {
            var isKeyExists = localStorage.hasOwnProperty(k);
            if(isKeyExists) {
                sessionStorage.setItem(k, localStorage[k]);
            }
            localStorage.removeItem(k);
        });
        var valueInStore = sessionStorage.getItem("access_token");
        var tokenInit = sessionStorage.getItem("__token_init");
        if(tokenInit != null && valueInStore != null && Date.now() >= parseInt(tokenInit) + 59 * 60 * 1000){ // check after 59th minute
            valueInStore = null;
            sessionStorage.removeItem("access_token");
        }

        var auth_process = sessionStorage.getItem("__auth_process");
        if ((valueInStore == null && auth_process == null) || (valueInStore == 'undefined' && (auth_process == null || auth_process == "true"))) {
            var accountsUrl = "https://accounts.zoho.com/oauth/v2/auth"
            var clientId;
            var scope;
            var redirectUrl;
            if(token != null) {
                clientId = token.clientId;
                scope = token.scope;
                redirectUrl = token.redirectUrl;
            }

            var fullGrant = sessionStorage.getItem("full_grant");
            var grantedForSession = sessionStorage.getItem("granted_for_session");
            if(sessionStorage.getItem("__token_init") != null && ((fullGrant != null && "true" == full_grant) || (grantedForSession != null && "true" == grantedForSession))) {
                accountsUrl += '/refresh';
            }
            if (clientId && scope) {
                sessionStorage.setItem("__token_init", Date.now());
                sessionStorage.removeItem("access_token");
                sessionStorage.setItem("__auth_process", "true");
                window.open(accountsUrl + "?" + "scope" + "=" + scope + "&"+ "client_id" +"=" + clientId + "&response_type=token&state=zohocrmclient&redirect_uri=" + redirectUrl);
                ["granted_for_session", "access_token","expires_in","expires_in_sec","location","api_domain","state","__token_init","__auth_process"].forEach(function (k) {
                    var isKeyExists = localStorage.hasOwnProperty(k);
                    if(isKeyExists){
                        sessionStorage.setItem(k, localStorage[k]);
                    }
                    localStorage.removeItem(k);
                });
                valueInStore = sessionStorage.getItem("access_token");
            }
        }
        if(token != null && valueInStore != 'undefined'){
            token.accessToken = valueInStore;
        }
        return token.accessToken;
    }

    async makeAPICall(requestDetails) {
        return new Promise(function (resolve, reject) {
            var body, xhr, i;
            body = requestDetails.body || null;
            xhr = new XMLHttpRequest();
            xhr.withCredentials = true;
            xhr.open(requestDetails.method, requestDetails.uri, true);
            for (i in requestDetails.headers) {
                xhr.setRequestHeader(i, requestDetails.headers[i]);
            }
            xhr.send(body);
            xhr.onreadystatechange = function() {
                if(xhr.readyState == 4) {
                    resolve(xhr);
                }
            }
        })
    }
}
Copiedresponse = invokeurl
[
	url: "https://www.zohoapis.com/crm/v2/users"
	type: GET
	connection:"crm_oauth_connection"
];
info response;

Response JSON Keys

  • country, city, street, state, country_locale, zipstring

    Represents the address of the user.

  • roleJSON object

    Represents the name and ID of the role of the user.

  • localestring

    Represents the user's locale. For instance, 'en_IN'.

  • Modified_ByJSON object

    Represents the name and ID of the user who last modified the user's details.

  • Currencystring

    Represents the user's currency preference.

  • aliasstring

    Represents the alias name of the user.

  • idstring

    Represents the unique ID of the user.

  • fax, email, mobile, phonestring

    Represents the contact details of the user.

  • first_namestring

    Represents the first name of the user.

  • Reporting_ToJSON object

    Represents the name and ID of the user to whom the user reports to.

  • created_timestring

    Represents the date and time at which the user was created.

  • websitestring

    Represents the user's website details.

  • Modified_Timestring

    Represents the date and time at which the user's details were last modified.

  • profileJSON object

    Represents the name and ID of the profile of the user.

  • last_namestring

    Represents the last name of the user.

  • time_zonestring

    Represents the current user's timezone.

  • created_byJSON object

    Represents the name and ID of the user who created the user.

  • zuidstring

    Represents the ZUID of the current user.

  • confirmboolean

    Represents if the user is a confirmed user.
    true: The user is a confirmed user.
    false: The user is not a confirmed user.

  • full_namestring

    Represents the full name of the user in the format specified in "name_format" key.

  • territoriesJSON array

    Each object in the array represents the details the user's territory.

  • dobstring

    Represents the date of birth of the user.

  • date_formatstring

    Represents the date format. For instance, 'MM/dd/yyyy'.

  • time_formatstring

    Represents the time format. For instance, 'hh:mm a'.

  • statusstring

    Represents the status of the user.
    active: The user is active.
    inactive: The user is inactive.

  • signaturestring

    Represents the user's signature.

  • name_formatstring

    Represents the format of the full_name of the user. For instance, 'Salutation,First Name,Last Name'.

  • languagestring

    Represents the language in which the user accesses the CRM. For instance, 'en_US'.

  • microsoftboolean

    Represents if the user is a microsoft user.
    true: The user is a microsoft user.
    false: The user is a microsoft user.

  • personal_accountboolean

    Represents if the user is the only user in the organization.
    true: The user is the only user in the organization.
    false: The user is not the only user in the organization.

  • Isonlineboolean

    Represents if the user is online.
    true: The user is online.
    false: The user is offline.

  • themeinteger

    Represents the details of the theme selected by the user.

Possible Errors

  • INVALID_URL_PATTERNHTTP 404

    Please check if the URL trying to access is a correct one
    Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to request URL section above.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized
    Resolution: Client does not have ZohoCRM.users.READ scope. Create a new client with valid scope. Refer to scope section above.

  • NO_PERMISSIONHTTP 403

    Permission denied to read
    Resolution: The user does not have permission to read user records. Contact your system administrator.

  • INTERNAL_ERRORHTTP 500

    Internal Server Error
    Resolution: Unexpected and unhandled exception in the server. Contact support team.

  • INVALID_REQUEST_METHODHTTP 400

    The http request method type is not a valid one
    Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to endpoints section above.

  • AUTHORIZATION_FAILEDHTTP 400

    User does not have sufficient privilege to read users
    Resolution: The user does not have the permission to read users. Contact your system administrator.

  • PATTERN_NOT_MATCHEDHTTP 400

    Please check whether the input values are correct
    Resolution: The value specified for the 'type' parameter is incorrect. Refer to parameters section above and specify valid parameter value.

Sample Response

Copied{
  "users": [
    {
      "country": "US",
      "customize_info": {
        "notes_desc": null,
        "show_right_panel": null,
        "bc_view": null,
        "show_home": false,
        "show_detail_view": true,
        "unpin_recent_item": null
      },
      "role": {
        "name": "CEO",
        "id": "4150868000000026005"
      },
      "signature": "<div><a id=\"link\" href=\"https://crm.zoho.com/bookings/ProjectDemo?rid=4b1b5d511ac5628eb3045495192827cc7f2f04de31c657e50f194521b21a27f5gid25837b76288d7b127a3faccd84a936702ba8ac270b0949d1521e82e1a251c1e5\" target=\"_blank\">Patricia Boyle</a></div>",
      "city": null,
      "name_format": "Salutation,First Name,Last Name",
      "language": "en_US",
      "locale": "en_US",
      "microsoft": false,
      "personal_account": false,
      "default_tab_group": "0",
      "Isonline": true,
      "Modified_By": {
        "name": "Patricia Boyle",
        "id": "4150868000000225013"
      },
      "street": null,
      "Currency": "DZD",
      "alias": null,
      "theme": {
        "normal_tab": {
          "font_color": "#FFFFFF",
          "background": "#222222"
        },
        "selected_tab": {
          "font_color": "#FFFFFF",
          "background": "#222222"
        },
        "new_background": null,
        "background": "#F3F0EB",
        "screen": "fixed",
        "type": "default"
      },
      "id": "4150868000000225013",
      "state": "Tamil Nadu",
      "fax": null,
      "country_locale": "US",
      "first_name": "Patricia",
      "email": "patricia.b@zylker.com",
      "Reporting_To": null,
      "decimal_separator": "en_IN",
      "zip": null,
      "created_time": "2019-08-20T11:21:16+05:30",
      "website": "www.zylker.com",
      "Modified_Time": "2020-07-14T18:30:01+05:30",
      "time_format": "hh:mm a",
      "offset": 19800000,
      "profile": {
        "name": "Administrator",
        "id": "4150868000000026011"
      },
      "mobile": null,
      "last_name": "Boyle",
      "time_zone": "Asia/Calcutta",
      "created_by": {
        "name": "Patricia Boyle",
        "id": "4150868000000225013"
      },
      "zuid": "694579958",
      "confirm": true,
      "full_name": "Patricia Boyle",
      "territories": [
        {
          "manager": true,
          "name": "Zylker",
          "id": "4150868000000236307"
        }
      ],
      "phone": null,
      "dob": null,
      "date_format": "MM/dd/yyyy",
      "status": "active"
    },
    {
      "country": null,
      "role": {
        "name": "Sales department Head",
        "id": "4150868000000231921"
      },
      "city": null,
      "language": "en_US",
      "locale": "en_US",
      "microsoft": false,
      "Isonline": false,
      "Modified_By": {
        "name": "Patricia Boyle",
        "id": "4150868000000225013"
      },
      "street": null,
      "Currency": "DZD",
      "alias": null,
      "id": "4150868000000231929",
      "state": null,
      "fax": null,
      "country_locale": "US",
      "first_name": "Jack",
      "email": "jack.s@zylker.com",
      "Reporting_To": null,
      "zip": null,
      "created_time": "2019-08-20T12:39:23+05:30",
      "website": null,
      "Modified_Time": "2020-07-14T18:30:01+05:30",
      "time_format": "hh:mm a",
      "offset": 19800000,
      "profile": {
        "name": "Administrator",
        "id": "4150868000000026011"
      },
      "mobile": null,
      "last_name": "Smith",
      "time_zone": "Asia/Calcutta",
      "created_by": {
        "name": "Patricia Boyle",
        "id": "4150868000000225013"
      },
      "zuid": null,
      "confirm": false,
      "full_name": "Jack Smith",
      "territories": [],
      "phone": null,
      "dob": null,
      "date_format": "MM/dd/yyyy",
      "status": "disabled"
    },
    {
      "country": null,
      "role": {
        "name": "Sales rep",
        "id": "4150868000000231917"
      },
      "city": null,
      "language": "en_US",
      "locale": "en_US",
      "microsoft": false,
      "Isonline": false,
      "Modified_By": {
        "name": "Patricia Boyle",
        "id": "4150868000000225013"
      },
      "street": null,
      "Currency": "DZD",
      "alias": null,
      "id": "4150868000000252644",
      "state": null,
      "fax": null,
      "country_locale": "US",
      "first_name": "Jane",
      "email": "Jane.J@zylker.com",
      "Reporting_To": null,
      "zip": null,
      "created_time": "2019-08-22T15:02:16+05:30",
      "website": null,
      "Modified_Time": "2020-07-14T18:30:01+05:30",
      "time_format": "hh:mm a",
      "offset": 19800000,
      "profile": {
        "name": "Administrator",
        "id": "4150868000000026011"
      },
      "mobile": null,
      "last_name": "J",
      "time_zone": "Asia/Kolkata",
      "created_by": {
        "name": "Patricia Boyle",
        "id": "4150868000000225013"
      },
      "zuid": null,
      "confirm": false,
      "full_name": "Jane J",
      "territories": [
        {
          "manager": false,
          "name": "Sample Territory",
          "id": "4150868000000264087"
        }
      ],
      "phone": null,
      "dob": null,
      "date_format": "MM/dd/yyyy",
      "status": "disabled"
    }
  ],
  "info": {
    "per_page": 200,
    "count": 3,
    "page": 1,
    "more_records": false
  }
}