Kaizen 173: A Comparison of Zoho CRM REST APIs and GraphQL APIs.

Kaizen 173: A Comparison of Zoho CRM REST APIs and GraphQL APIs.


Hello everyone!
Welcome back to another week of Kaizen!

Zoho CRM offers two API architectures for its users: REST API and GraphQL API. Each of these API architectures has its own strengths and ideal use cases. In this post, we will discuss the difference between REST API and GraphQL API.

REST APIs, or RESTful APIs, allow clients to interact with server resources using standard HTTP methods such as GET, POST, PUT, PATCH, and DELETE. GraphQL is a query language that provides a more flexible and efficient way to access data and metadata within your Zoho CRM. Unlike REST APIs that return fixed datasets, GraphQL allows you to request specific resources, fields of the resources and relationships of the resources, reducing redundant data and streamlining your development process.

Endpoints

REST APIs access information through dedicated endpoints. 

REST APIs: Multiple endpoints for different resources

In contrast, GraphQL APIs operate through a single endpoint. In Zoho CRM, it is {api-domain}/crm/graphql

GraphQL APIs: Single endpoint for different resources

Over-fetching and under-fetching of data

REST APIs use Unique Resource Identifiers (URIs) for identifying resources. This approach allows clients to access specific data, but it can also lead to inefficiencies such as over-fetching or under-fetching of information. Over-fetching occurs when the client receives much more data than it requires. Under-fetching occurs when the client requires to send multiple requests to fetch all the data it requires.
In GraphQL APIs, the client controls the structure of the response by specifying the exact information they need.  This enables the clients to have precise data control and avoids over-fetching and under-fetching of data. It fetches required data from different resources and provides it as a single resource.

Schema Introspection

GraphQL APIs have a schema that outlines the different types of data that can be queried in the server. This is like a blueprint for the API and serves as a contract between the server and client for data exchange. Refer to this post on Interpreting Zoho CRM GraphQL schema for more details.

Editions supported

REST APIs are available across all versions of Zoho CRM, including trial versions. GraphQL APIs are supported for Enterprise, Zoho One Enterprise, CRM Plus and Ultimate edition orgs. Please note that GraphQL APIs are not available for trial edition of these editions.

Status Codes

Zoho CRM GraphQL APIs mostly return 200 status code except for a few errors that return 400 status code. Refer to this page on GraphQL error and status code for details.
Zoho CRM REST APIs return different status codes. Refer to this page on REST API status code for more details.

Credits Consumption

   API rate limiting is crucial to ensure fair resource distribution, maintain optimal service quality for all users, and safeguard our system from potential security threats.
Both Zoho CRM REST APIs and Zoho CRM GraphQL API calls are associated with credits. Number of credits consumed depends on the intensity of the API call. 
Additionally, Zoho CRM REST APIs have Concurrency and Sub-concurrency limits. Concurrency limits the number of API calls that can be active at one time instance. It varies across different editions of Zoho CRM. For a few APIs that are more resource-intensive, there is an additional limit called sub-concurrency, The APIs that will fall under the sub-concurrency limit are
  • Get Records with cvid or sort_by parameters
  • Convert Lead
  • Insert, Update, or Upsert records (when the record count is greater than 10)
  • Send Mail
  • Search records API invoked from function
  • Query API
  • Composite API
Sub-concurrency limit across different editions is 10. 
 In GraphQL APIs, we have different concepts called Complexity, and Depth. Query Complexity refers to the workload imposed on servers by a specific query. This complexity increases with the number of fields requested and the depth of the query structure. Query Depth refers to the nesting level of a field that is being queried. In Zoho CRM GraphQL APIs it is limited to seven.

Suitable scenarios for GraphQL APIs and REST APIs

Let’s explore a scenario - the case of Zylker Manufacturing, an industrial equipment manufacturer. Their sales team uses Zoho CRM to enhance their sales operations and manage customer relationships effectively. Meanwhile, their sales support team relies on a legacy system to oversee their activities. 
The support team needs to retrieve comprehensive information about one account and its associated contacts to track all support tickets related to that account. They also need associated deals of the account for contextual information.
With GraphQL APIs they can use a single API call to fetch all required information to create a unified view. The below query fetches specific data related to Accounts and their Contacts and Deals, as well as metadata about the fields in the Accounts , Contacts and Deals modules.

{
    Records {
        Accounts(where: { Account_Name: { like: "%King%" } }) {
            _data {
                Account_Name {
                    value
                }
                Contacts__r {
                    _data {
                        Email {
                            value
                        }
                        Full_Name {
                            value
                        }
                    }
                }
                Deals__r {
                    _data {
                        Expected_Revenue {
                            value
                        }
                        Deal_Name {
                            value
                        }
                        Stage {
                            value
                        }
                    }
                }
            }
        }
    }
    account_meta: Meta {
        Modules(filter: { api_name: "Accounts" }) {
            _data {
                plural_label
                id
                api_name
                module_name
                description
                singular_label
                fields(filter: { api_names: "Account_Name" }) {
                    _data {
                        id
                        api_name
                        display_label
                        json_type
                        data_type
                    }
                }
            }
        }
    }
    contact_meta: Meta {
        Modules(filter: { api_name: "Contacts" }) {
            _data {
                plural_label
                id
                api_name
                module_name
                description
                singular_label
                fields(filter: { api_names: ["Email", "Full_Name"] }) {
                    _data {
                        id
                        api_name
                        display_label
                        json_type
                        data_type
                    }
                }
            }
        }
    }
    deals_meta: Meta {
        Modules(filter: { api_name: "Deals" }) {
            _data {
                plural_label
                id
                api_name
                module_name
                description
                singular_label
                fields(filter: { api_names: ["Expected_Revenue", "Deal_Name", "Stage"] }) {
                    _data {
                        id
                        api_name
                        display_label
                        json_type
                        data_type
                    }
                }
            }
        }
    }
}


Using REST APIs in this scenario will require multiple API calls to the following APIs
  • Query API
  • Related Records API
  • Modules meta API, and 
  • Fields meta API.
We had explored another scenario involving Zylker Manufacturing in detail in an earlier Kaizen post where their sales support team needed the below details from Zoho CRM
  • details of the contact, such as email, phone, and Account details
  • details of the ongoing deals of the contact, including potential revenue and stages. 

GraphQL APIs are beneficial in these cases as they can fetch the required data in a single data query.  

Conversely, in simpler use cases, REST APIs may be more suitable. Let’s examine a second scenario involving an inventory management system. Zenith Products needs to manage its product catalog. The inventory management system requires the ability to:
  • Fetch Details of a Single Product
  • Fetch Details of Multiple Products
  • Update Product Information
 Each product can be accessed via a unique URL (endpoint), allowing for straightforward requests. For example:
  • To fetch a single product: GET /crm/{version}/products/{product_id}
  • To fetch multiple products: GET /crm/{version}/products
  • To update a product: PUT /crm/{version}/products/{product_id}
In such cases, REST APIs are preferred due to their simplicity.

Note
Currently, Zoho CRM GraphQL APIs only support queries. Queries allow you to fetch data from the server.

You can choose to use Zoho CRM REST APIs or GraphQL APIs depending on the specific need of your application. REST APIs are suitable for straightforward data retrieval needs whereas GraphQL is useful in situations involving complex queries and need precise data control.
We hope you found this post useful. Stay tuned for more insights in our upcoming Kaizen posts!

Info
More enhancements in the COQL API are now live in Zoho CRM API Version 7. Check out the V7 Changelog for detailed information on these updates.

Cheers!
Mable

    Access your files securely from anywhere


            Zoho Developer Community





                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day


                                      • Ask the Experts



                                          Zoho Marketing Automation


                                                  Manage your brands on social media



                                                        Zoho TeamInbox Resources

                                                          Zoho DataPrep Resources



                                                            Zoho CRM Plus Resources

                                                              Zoho Books Resources


                                                                Zoho Subscriptions Resources

                                                                  Zoho Projects Resources


                                                                    Zoho Sprints Resources


                                                                      Qntrl Resources


                                                                        Zoho Creator Resources



                                                                            Zoho CRM Resources

                                                                            • CRM Community Learning Series

                                                                              CRM Community Learning Series


                                                                            • Kaizen

                                                                              Kaizen

                                                                            • Functions

                                                                              Functions

                                                                            • Meetups

                                                                              Meetups

                                                                            • Kbase

                                                                              Kbase

                                                                            • Resources

                                                                              Resources

                                                                            • Digest

                                                                              Digest

                                                                            • CRM Marketplace

                                                                              CRM Marketplace

                                                                            • MVP Corner

                                                                              MVP Corner





                                                                                Design. Discuss. Deliver.

                                                                                Create visually engaging stories with Zoho Show.

                                                                                Get Started Now


                                                                                  Zoho Show Resources


                                                                                    Zoho Writer Writer

                                                                                    Get Started. Write Away!

                                                                                    Writer is a powerful online word processor, designed for collaborative work.

                                                                                      Zoho CRM コンテンツ






                                                                                        Nederlandse Hulpbronnen


                                                                                            ご検討中の方





                                                                                                  • Recent Topics

                                                                                                  • Issue with Bin Locations and Stock Counting in Zoho Inventory

                                                                                                    Dear Zoho Support, We are currently experiencing a significant issue with bin locations and stock counting in our warehouse. Our warehouse is divided into 7 zones, each containing approximately 250 bin locations. When performing a stock count for an item,
                                                                                                  • How to block a WhatsApp user for sending spam

                                                                                                    Is there a way to block those whatsapp users that just come to play and annoy our service, they also spam us. We have a waba service with sales iq
                                                                                                  • Is it possible to load a Module with a filter pre-applied by the URL?

                                                                                                    In many of the CRM related lists, there is limited sorting, and no filtering available. I thought of the idea of putting a Custom Button on a Related List that would take the user to that module, but PRE-FILTERED by the Account from where they were viewing
                                                                                                  • Automatically create support tickets on a recurring basis

                                                                                                    As mentioned in this post, the idea of a recurring ticket is pretty valid. From time to time, we have to create repetitive tickets (like windows update tasks, restore simulation of backups, check firewall rules for unused entries, and so on). I guess this is a very important tool for Service/Help Desk purposes, so we doesn't have to create a internal schedule (on Microsoft Outlook or Google calendar) to remember to open a new ticket every week/month/etc.
                                                                                                  • Edit ticket number format or append to ticket subject?

                                                                                                    Is there a way to edit the subject in emails sent out from Zoho Desk? At the moment I get: [##123##] Ticket title But this is basically impossible to filter on in Gmail, as [ and # are classified as special characters, so can't be used in a filter. Ideally
                                                                                                  • Workflows being applied and the Large unwanted popup

                                                                                                    When a workflow is being applied do to an action, then the Agent is left with a large Window asking if they would like the see the changes this workflow did. Is there any way to disable this prompt from appearing?
                                                                                                  • Restrict Payment Methods

                                                                                                    Allow us to restrict certain payment methods specific for each customer.
                                                                                                  • Agent view history on tickets

                                                                                                    We are converting to Zoho Desk and am curious if there is a feature that we have in our existing ticketing platform. In our current system, we are able to see which agents have viewed a ticket. It includes their first read and last read of the ticket.
                                                                                                  • Setting priority on tickets created from email channel

                                                                                                    Is there a way to automatically assign a priority to email tickets? We'd like to set them all to standard when they initially come in.
                                                                                                  • Automation #16: Automate Ticket Reopening on Scheduled Timestamp

                                                                                                    Hello Everyone! This edition uncovers the option to schedule reopening a ticket automatically. Zylker Finance tracks insurance policyholder activities through Zoho Desk. For policyholders who pay monthly premiums, tickets are closed upon payment completion.
                                                                                                  • חסרה אופציה בביטול עסקה

                                                                                                    לא מופיע אופציה לכתוב מס הזמנה שעושים ביטול מאתר
                                                                                                  • Help with cookie code, utm variables are overwritten on every page load with new variables

                                                                                                    Hi all, My goal is to track the very first web page that a user visits, and store those utm values throughout all of the future visits until a lead form is submitted. That way, if a person is retargeted, I can still attribute the very first visit as the
                                                                                                  • Introducing Bot Filtering for Accurate Email Campaign Analytics

                                                                                                    Dear Marketers, We're excited to announce a new feature designed to enhance the accuracy of your email campaign analytics: bot filtering. This feature helps you filter out bot-generated opens and clicks, ensuring your campaign reports reflect genuine
                                                                                                  • Automation #9 - Convert Zoho Desk Tickets to New Deals in Zoho CRM

                                                                                                    This is a monthly series designed to help you get the best out of Desk. We take our cue from what's being discussed or asked about the most in our community. Then we find the right use cases that specifically highlight solutions, ideas and tips on optimizing
                                                                                                  • Ticket Assignment tool

                                                                                                    I have built an tool which help to assign the emails to the specific department but I want to use it with zoho desk or if its possible then you can help me with it to use it on your wide scale
                                                                                                  • Restructured the Company Information page into distinct sections

                                                                                                    Hello everyone, We’ve made significant updates to the Company Information page to enhance usability and streamline your experience. These changes are part of our ongoing efforts to restructure the feature pages across the product. What has changed? Previously,
                                                                                                  • Zoho Books Invoices Templates

                                                                                                    It would be really helpful to have more advanced features to customise the invoice templates in Zoho Books. Especially I´m thinking of the spacing of the different parts of the invoice (Address line etc.). If you have a sender and receiver address in
                                                                                                  • Customers would like to add tips when paying in Client Portal

                                                                                                    I am happy with the clean interface of the Client Portal. However, I am running into a challenge: my customers would like to be able to add tips/gratuities when making payments. Currently, this is very clunky because they have to 1) manually over-pay,
                                                                                                  • How can I add a calendar invite to my campaign emails?

                                                                                                    I use Zoho Campaigns to attract prospects to a series of webinars that we run. I have a general pool of contacts that I campaign to, and I have them join a new list for the specific webinar they wish to join. What I would like to do next is send an email to those that want to join a webinar, with a calendar invite that they can accept to add to their Outlook calendars (containing the URL and details of the webinar). How can I do this?
                                                                                                  • Exit Sub

                                                                                                    Hi Everyone, I have some script that evaluates multiple conditions, using some nested if statements.  If any of the conditions evaluates to true, there is no reason to continue the running through the other conditions. Is there an Exit Sub command in Deluge? Thanks, Leo
                                                                                                  • Please add support for a "return" statement that can be used in the middle of a function

                                                                                                    I'd really appreciate the ability to use a validity test near the beginning of a Deluge function and exit the function early if the test fails. That is, support a "return" keyword that immediately exits the function. This helps avoid messy concentric
                                                                                                  • Case and Left Join Problem

                                                                                                    I am attempting to find the cost per lead, however they are on different tables. I am using the Case and Left Join Functions to do so. The following Queries are working correctly. These are below: SELECT "Campaign", COUNT("Id") AS 'total_leads' FROM "Deals"
                                                                                                  • Calling a function within another function

                                                                                                    Hello there, I have just found out that you can simply call up functions in other functions, regardless of the department. You can't create functions with the same name twice, even though you are in a different department. If you try it, you don't get
                                                                                                  • Enhancing Data Accuracy: Bot Filtering & Apple Mail Privacy Protection Compliance

                                                                                                    Dear Marketers, The wait is over! We’re thrilled to share that the enhanced bot filtering feature is now live in Zoho Marketing Automation. Thank you for your patience as we refined this tool to deliver deeper insights into your campaign performance.
                                                                                                  • High cpu load on client side by process sessionaudit.exe

                                                                                                    Hi, as stated above. This happens every time with different clients. Now, the first thing I have to do after making the connection is to go to taskmanager on client computer and kill the process 'sessionaudit.exe' If I don't their cpu is very high and
                                                                                                  • Recurring Events Not Appearing in "My Events" and therefore not syncing with Google Apps

                                                                                                    We use the Google Sync functionality for our events, and it appears to have been working fine except: I've created a set of recurring events that I noticed were missing from my Google Apps calendar. Upon further research, it appears this is occurring
                                                                                                  • Posibility to add Emoticons on the Email Subject of Templates

                                                                                                    Hi I´ve tried to add Emoticons on the Subject line of Email templates, the emoticon image does show up before saving the template or if I add the Emoticon while sending an Individual email and placing it manually on the subject line. Emoticons also show
                                                                                                  • Case assignment rules cannot be triggered when records are created manually???

                                                                                                    I am new to Zoho, (Coming out of Salesforce) and I am shocked that Case assignment rules do not work for manually created cases. I think this is a basic need for a CRM and should be a functionality for Zohos native cases module. In Salesforce the Case
                                                                                                  • Zoho DataPrep and File Pattern configuration

                                                                                                    I'm using Zoho data prep to ingest data from One Drive into Zoho Analytics... The pipeline is super simple but I can't any way to get all the files that I need. Basically I need to bring all the files with a certain pattern and for that I'm using a regex
                                                                                                  • Is there an equivalent to the radius search in RECRUIT available in the CRM

                                                                                                    We have a need to find all Leads and/or Contacts within a given radius of a given location (most likely postcode) but also possibly an address. I was wondering whether anyone has found a way to achieve this in the CRM much as the radius search in RECRUIT
                                                                                                  • Restrict SalesIQ Account Notifications to Admins

                                                                                                    Dear Zoho SalesIQ Team, We appreciate the continuous improvements in SalesIQ. However, we have noticed that all users, including employees who do not have admin privileges, receive certain account-related notifications—such as the recent splash screen
                                                                                                  • Feature Request: Search in the PC client. Some thoughts about the search.

                                                                                                    Hi all. I'm really excited to start using Zoho Notebook, but I'm missing some of the search capabilities on my desktop. There are also some thoughts on improving search in general. Search is very important to me, without it it is difficult for me to use
                                                                                                  • Introducing an option to set comments to public by default

                                                                                                    Hello all, Greetings! We are pleased to announce that Desk's user preferences now brings an option to set a comment type as Public or Private by default. In addition to setting reply buttons as defaults, Agents or Admins can now choose to make their ticket
                                                                                                  • Trying to setup a record to automatically create on a weekly basis

                                                                                                    Hello all, I need multiple records to be automatically created on a weekly basis. What I'm trying to accomplish is, I have a maintenance database where I track when I work on IT related systems. Every week on the same days I perform backups on systems
                                                                                                  • How to display Motivator components in Zoho CRM home page ?

                                                                                                    Hello, I created KPI's, games and so but I want to be able to see my KPI's and my tasks at the same time. Is this possible to display Motivator components in Zoho CRM home page ? Has someone any idea ? Thanks for your help.
                                                                                                  • Workflow rule to assign new case owner sends email to customer from Original owner issue

                                                                                                    I have a workflow rule to assign a manually created case from a sales rep. to a customer service repr to handle. I also have a workflow rule to send an introduction email from the case owner to the customer. The Problem: The email is going out on behalf
                                                                                                  • Annotate PDFs is Shown as New, but Where is it?

                                                                                                    In September 2017, "Annotate your PDF files" is shown under "Enhancements and bug Fixes". But no link. Where can I learn how to use the feature? https://www.zoho.com/notebook/whats-new.html
                                                                                                  • Quickly delete items in email builder?

                                                                                                    When deleting items in the email builder, it requires two clicks: one to hit the trash icon on the item, and then another click to confirm the delete. Is there anyway to skip the confirm deletion? Some kind of hot key like the Command button on the mac
                                                                                                  • Client Script | Update - Introducing Subform Events and Actions

                                                                                                    Are you making the most of your subforms in Zoho CRM? Do you wish you could automate subform interactions and enhance user experience effortlessly? What if you had Client APIs and events specifically designed for subforms? We are thrilled to introduce
                                                                                                  • Zoho Sign not working in Canada Feb 06, 2025

                                                                                                    When logging into zoho sign a short while ago we are seeing gibberish in the standard buttons, and when clicked on nothing happens, rendering the service broken. Please update and advise soonest.
                                                                                                  • Next Page