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



        • Recent Topics

        • Zoho Forms Lookups Not Accessible

          I am trying to set up a sign-in form where visitors can scan the QR code onsite, select the job from the lookup field, and it attaches to the job in the CRM. It looks like external users cannot use the lookup feature. Is this correct? It seems almost
        • Zoho Support is Dysfunctional & Don't Know Their Own Support Hours

          Seeking clarification on Zoho support hours and contact numbers please. We have been trying to phone Zoho support on +61 2 8066 2898 at 9:20am AEDT for the second day in a row, and gotten a message on Zoho's support line: "support is open monday through
        • Field Updated based off Call Status

          I'm trying to create a Field Update where: When Call Status is Completed Lead/Contact/Account Description field with the information in the "Outcome Of Outgoing Call" Description field. Once our sales team finishes their calls and they add a description
        • 【参加無料】3/19 東京ユーザ交流会 参加登録 受付開始!(新橋開催)

          ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 3月19日(水)に東京、新橋でユーザー交流会を開催します! 今年最初のユーザー交流会 東京・新橋では、Zoho Champion の松井さん、鈴田さんが登壇します。 Zoho CRM活用事例のセッション、参加者同士で自社の活用・運用について情報交換ができるグループワークや、CRM / Marketing Automationに関するパネルディスカッションも予定しています。 ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
        • Zoho CRM Workflow and Function Backup Options

          Hi everyone! I have been able to make several backups of my CRM data and noticed that the Workflows and Functions are not included in these backups. To my knowledge, there is no backup feature for workflows and functions, which is problematic in of itself.
        • Automating CRM backup storage?

          Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
        • Bulk Delete / Archive

          For me the Bulk delete and archive functions are not working anymore reliable. I get the message that the action is scheduled, but often it is not executed not even minutes later. To me, the user experience became terrible in the last month. It used to
        • Chat function not working properly

          Ever since upgrading to plus, the chat is all messed up. it is coming up behind the web page so that I cannot see what I'm typing and cannot read replies. I can only see the bottom of the text box at the bottom of the page, and then it is blocked. I've
        • Additional step for Deleting an app

          Have an additional step for deleting an app. When the popup occurs, the user needs to write "DELETE" into a text field. This is what Google does. At the moment, it is too easy to Delete, which increases risk, and this should be easy to implement.
        • 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
        • Scheduled function not firing workdrive.uploadFile task

          I have a creator app that takes submissions from a published form. I setup a daily scheduled function to send a record template of the form, as well as 3 different uploaded files to workdrive folders. (Initially I intended for this to happen on the submission
        • Automatic Email Alerts for Errors in Zoho Creator Logs

          Hello, We would like to request a feature enhancement in Zoho Creator regarding error notifications. Currently, Zoho Creator allows users to view logs and errors for each application by navigating to Zoho Creator > Operations > Logs. However, there is
        • 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,
        • 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.
        • 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
        • Invoice import error - duplicate customer name column - there are no duplicates

          It is not allowing the importing of any rows because of a duplicate customer name problem, but there are no duplicates in the custoemr name row. Has anyone dealt with this issue before?
        • 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
        • Now Indian Businesses can start accepting online payments with Zoho and Razorpay

          Hello Everyone, At Zoho, we have always ensured a hassle-free online payment experience for our customers. Today, with our integration with Razorpay, Zoho's customers from India can now offer a seamless checkout experience for one-time and recurring payments, with a host of payment options including card payments, multiple wallet offerings, and net banking with over 50 banks. With Zoho and Razorpay, help your customers pay their way. Whether it's with debit cards, credit cards, wallets, or net banking,
        • 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
        • 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
        • 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??
        • 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.
        • 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.
        • 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:
        • Next Page