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

    Zoho Campaigns Resources


      • Desk Community Learning Series


      • Digest


      • Functions


      • Meetups


      • Kbase


      • Resources


      • Glossary


      • Desk Marketplace


      • MVP Corner


      • Word of the Day


      • Ask the Experts


        Zoho CRM Plus Resources

          Zoho Books Resources


            Zoho Subscriptions Resources

              Zoho Projects Resources


                Zoho Sprints Resources


                  Zoho Orchestly Resources


                    Zoho Creator Resources


                      Zoho WorkDrive Resources



                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

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

                            Zoho CRM コンテンツ






                              ご検討中の方

                                • Recent Topics

                                • Store Google reCAPTCHA Site Keys & Secrets in Zoho Forms

                                  Hello Zoho Forms Team, We appreciate the support for Google reCAPTCHA v2 (checkbox) and reCAPTCHA v2 (Invisible) in Zoho Forms. However, we have a significant usability concern regarding the current implementation. Current Limitation: Every time we want
                                • Enable Organization-Wide reCAPTCHA Settings in Zoho Forms

                                  Hello Zoho Forms Team, We appreciate the existing security options for Zoho Forms, including Google reCAPTCHA v2 (checkbox) and reCAPTCHA v2 (Invisible). However, we have a major usability concern: Current Limitation: Right now, CAPTCHA is a form-specific
                                • Add Support for Google reCAPTCHA v3 in Zoho Forms

                                  Hello Zoho Forms Team, We appreciate the security measures currently available in Zoho Forms, including Zoho CAPTCHA, Google reCAPTCHA v2 (checkbox), and reCAPTCHA v2 (Invisible). However, we would like to request the addition of support for Google reCAPTCHA
                                • Using Insert into to transfert a date in another form

                                  Hi, I have an order form that creates a record in a calendar form, for managing the delivery date. My customer can change that date in the calendar form, but i need the new date to be put in the original order form. I tried the following but it doesn't
                                • CASE Module - email function

                                  HI there, I dont know if this has been asked or answered before as i couldnt find it on the forums. Issue: when a new case is raised, it goes under case tab and everything is captured. Then how do i send emails to the client who raised case with the details
                                • Does Zoho US Payroll now support employees in multiple states?

                                  Does Zoho US now support having employees in multiple US states? I looked at the site and can't find and of the restrictions on multiple states anywhere.
                                • Last Name / First Name

                                  Hello ,  My company adds contacts on a "Last Name , First Name" basis. We've noticed that when viewing accounts there is no  " , " (comma). It's VERY misleading.  I have set the custom view to show "last name" "first name" instead it joins them both and merges them. Even after you create a contact and you re enter it states "contacts name" instead of "last name" , First name" I have already changed the arrangement of name display in user settings. We need to be able to distingush name orders. Attached
                                • Desk Contact Name > split to First and Last name

                                  I am new to Zoho and while setting up the Desk and Help Center, I saw that new tickets created or submitted from the Help Center used the Contact Name field. This would create a new Contact but put the person's name in the Last Name field only. The First
                                • Extract first and last name

                                  I am trying to build a custom function in Flow, when a new Zoho Booking is added I want to split the Name field into first last name.  I understand the function needs to be a string and this works but I am unsure how to write this in the flow script.  result = first_name.getPrefix(" "); info result; I also assume to then create the last name Ill use the same but getSufix  Any help greatly appreciated.  :-)
                                • Import template from Zoho Writer

                                  I am trying to import a mail merge template - tried to import direct from my .docx file on my hard drive and the formatting went all over the place.  I then imported the .docx file in my Zoho Docs and then fixed up the formatting within Zoho Writer. Can I now import that template directly from Zoho Docs into my templates in Zoho CRM??
                                • Introducing the New SalesIQ Live Chat Widget: Twice as Fast, Fully Optimized for Engagement!

                                  Hello everyone! To celebrate our 10-year milestone, we're thrilled to unveil the new and improved SalesIQ Live Chat Widget! Redesigned at both the User Interface and performance levels, this enhanced widget is not only optimized but also 2X faster than
                                • Passing Information from ZohoCRM to ZohoCreator

                                  I've got a use case where I'm attempting to use a button within ZohoCRM to pull a list of options into buttons on creator when page is loaded. I'm pretty well versed in Deluge, but I'm having a difficult time trying to understand how to dynamically place
                                • How do I connect a Google Cloud Project as a Custom Service

                                  How can I connect a Google Cloud project as a custom service to ZohoCRM? I need to pull YouTube Analytics data into CRM, but I cannot use the included YouTube service as it does not have the scopes I need. Therefore, I need to create a custom service.
                                • Member Portal with Subscriptions

                                  We are a subscription box business using Zoho One.  How do our members login to make changes to their subscriptions, contact details, etc.  Is there a portal?  If not, what should we do to create one?  Also, we must be able to customize the portal with tabs and custom fields.  Finally, we need form and survey information to show up in the portal with some items editable and others read only.  I really need this information soon.  Thank you! Paige
                                • How to select alternate invoice email notification template

                                  When we reissue an invoice, we want to send a different notification email. I am able to set up the alternate email body using Email Notifications/Invoice Notification settings, but I can't figure out how to attach that template to a specific invoice.
                                • Rearrange web - hidden components

                                  When you have a good number of forms, reports and pages, searching for one among the hidden components to add it to the menu is simply hell. Huge amounts of time are wasted.
                                • Telegram -> Zoho Creator answer via API.

                                  Hello! Did anyone work or established back connection from Telegram to Zoho Creator via API? I'm able to send notification from ZC to TG Bot successfully. (webhook is set) My notification consists of some information and inline buttons "yes" and "no".
                                • How Can I Easily Access and Manage My GEPCO Online Bill Using Zoho Sheets?

                                  Hello everyone, I'm looking for an efficient way to access and manage my GEPCO online bills. I've heard that Zoho Sheets can be a powerful tool for organizing and tracking bills, but I'm not sure how to set it up for this specific purpose. Does anyone
                                • Update a form record based on another form with same user ID

                                  Hi, I have 2 forms linked : Customer and Subscription When a customer fills-in a subsequent subscription form, there is a automatic subscription number created in the subscription form that I want to paste in a miroir field in the customer field. What
                                • Notes Filter is not working

                                  I am trying to filter the CRM down to specific notes that I want that'll show up all the data that has a specific keyword for example, "stocks" and it says no leads are found... Don't know how to fix. don't know if it's a system glitch. I even put a note
                                • How to Initiate WhatsApp Message on SalesIQ?

                                  I've just activated a Business WhatsApp phone number through SalesIQ because of its touted omnichannel chat approach. Sounds exciting. I understand that when a customer sends me a WA message, I can reply to it on SalesIQ and keep the chat going, perfect.
                                • E-mails to suppliers

                                  Hi, i want to upload a spread sheet every day and send an e-mail to our suppliers every day (or when triggering a button?) with info from the spreadsheet lines. The supplier e-mail would be on each line. Unfortunately, when creating a scheduled automation,
                                • How can I transfer data from Production to Development environment?

                                  Hi, I am using Creator V6 and would like to bring all the data in production to the Development and Testing environments? Is there an easy way of doing that or I have to export and import each table?
                                • Issue Configuring SSO Integration with Cognito in Zoho Help Center

                                  Dear Zoho Support Team, We have been working on configuring SSO integration for our Zoho Help Center using Amazon Cognito. While the setup appears to be completed successfully, we are encountering an issue when attempting to access the Help Center. The
                                • Custom Roles & Granular Permission Control in Zoho SalesIQ

                                  Hello Zoho SalesIQ Team, We appreciate the functionalities offered by Zoho SalesIQ, but we would like to request a crucial enhancement regarding user roles and permissions. Current Issue: At present, Zoho SalesIQ provides fixed roles—Admin, Supervisor,
                                • Zoho Creator Upcoming Updates - October 2023

                                  Hello all! As we step into the final quarter of this year, we're ushering in a fresh wave of improvements and new features to supercharge your experience with Zoho Creator. Join us today as we present the newest updates and enhancements for this month:
                                • Sales without an invoice

                                  Sales without an invoice is not included on the “payments received” report. Also, sales without an invoice is not listed in the transactions under the customer’s profile, also making it easy to do a double entry. Is there a way for me to see my sales
                                • Rebrand your CRM with the all-new custom domain mapping setup

                                  UPDATES TO THIS FEATURE! 19th Jan, 2024 — Custom domain mapping has been made available for portal users in Zoho One and CRM Plus. 23rd June, 2023 — Custom domain mapping has been made available for all users, in all DCs. Hello everyone! We are elated
                                • Nested Sub-forms (Subform within subform)

                                  Hi Team, Whether there is any possibilities to add sub-form with in another sub-form like Main Form       -> Sub form A             ->Sub form B If we tried this, only one level of sub form only working.  Any one having any idea about this? Thanks Selvamuthukumar R
                                • Enhancements to the formula field in Zoho CRM: Auto-refresh formulas with the "Now" function, stop formula executions based on criteria, and include formulas within formulas

                                  Dear Customers, We hope you're well! By their nature, modern businesses rely every day on computations, whether it's to calculate the price of a product, assess ROI, evaluate the lifetime value of a customer, or even determine the age of a record. With
                                • Zoho CRM Kiosk Upload Files

                                  Hello all, We are trying out Kiosks at the moment to see where it can fit best in our business. We are still a bit off in the application but lets say we will sort this out. My question is the following - when I create a Kiosk I can add "File Upload"
                                • Delay Function

                                  Hello, I would like to emphasize the importance of incorporating a delay functionality within custom functions, particularly in the context of integrating multiple platforms. As I understand, a delay function is not available by default in Zoho. However,
                                • 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
                                • Whatsapp Connection Status still "Pending" after migration

                                  Hello, I migrated my WhatsApp API to Zoho from another provider a day ago. So far the connection status is still “Pending”. There is a problem? How long does it usually take?
                                • Marking a Desk ticket as Unread after merge

                                  We have a custom script that runs against every new ticket and auto-merges it with any existing ticket that matches our criteria. That works fine but there is no functionality that reverts the newly-updated ticket back to an "unread" state. I found the
                                • How to add a customized/dynamic Zoho Booking link in email footer?

                                  We just installed the latest version of the Zoho Desk <=> Zoho Booking extension from the marketplace and are quite happy to see the feature where a ticket-specific appointment booking link can be inserted in a reply. Is there any way to configure this
                                • Date Time

                                  Hi Everyone, I would seek some help about this concern that bugs me. I'm currently working using Zoho Flow to automatically plot a calendar on the Calendar Report. Whenever a ticket from Zoho Desk Field was updated this will trigger to create a plotted
                                • How to change contact record owner to its creator?

                                  When I convert a lead record into a contact and a deal then a the contact record will have User AAAA as record owner, and the contact record will have User XXXX as the record creator. I don't have any workflow rules in Contact module. I use the blueprint
                                • Custom function inside a CUSTOM BUTTON - BOOKS CUSTOM MODULE

                                  I am trying to upload the attachment in a custom module(Books) to a work drive. One module is working, but another module(New) is not giving me the desired result as it is also giving an error. Of course, I changed the module name etc. Attaching the script
                                • Function to update field in CRM Meetings from Bookings Appointment Status

                                  Hello, We're creating some reporting in Zoho Analytics using data from CRM and Bookings. Unfortunately it looks like when Bookings Appointments are carried over to CRM Meetings, the Bookings Appointment Status is not recorded in CRM Meetings. We would
                                • Next Page