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

    • 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
    • Zoho one CRM - linking xero

      Hi Guys, new to Zoho but not having luck with premium support so thought I'd reach out here - I cant find the xero app on marketplace and needing some guidance how to link xero to our zoho one CRM. Also we have 3 users, one of which emails arnt linking
    • Zoho Books API Documentation shows the returned Expense ID as numeric, but the API actually returns a string.

      Screenshot of ZB API Documentation. Expense ID (marked in red) is numeric. Screenshot of Zoho Creator execution result of making a request to ZB API POST /expenses endpoint. Expense ID (marked in red) is a string.
    • When Zoho Tables Beta will be open to EU data center

      Hello all, We in EU are looking at you all using and testing and are getting jealous :) When we will be able to get into the beta also? We don't mind testing and playing with beta software. Thank you!
    • 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.
    • 一括メール送信について

      すべての連絡先 を設定し一括送信を行ったのですが250件しか送信できていないようです。 なぜでしょうか?プランの問題ですか?設定の問題ですか?
    • Cliq Channels - Permissions

      Hello All, As said in my previous post, I'm going to detail Permissions - set of actions one can perform in the channel. In more simple words it is the power that one wields in a channel to perform certain actions. You can go to Permissions through Channel Preview i.e. hover over the channel in LHS and click on info icon. There are total of 8 actions that constitute the Permissions. They are: Edit Channel info: Permission to edit the Channel title and description This info will be displayed in Channel
    • 5 powerful ways to boost e-commerce customer engagement with Zobot

      E-commerce has been a game changer for the past decade. It has drastically influenced the way people purchase. This pandemic broke all the existing rules by embracing automation and making the customer experience more personalized. Chatbots play a crucial
    • not letting add

      im trying to add people with the add user + or whatever on my cliq little conversation chats for some reason when i add my fellows, or they add me it is not goin through and we are not able to add eachother i was only able to add two people
    • Help upgrading from Zoho Workplace

      Is anyone able to assist with upgrading from Zoho Workplace to Zoho One? There appears to be no clear upgrade path. Thanks.
    • So I am trying to get a button to open a form with specific data, basically goods we haven't received yet.

      So the column is Date_received and I want to pull the all the ones that haven't had the date received added as =isnull. Is this right way of doing this or do I need add more to it?
    • Post to Bot doesn't work for Clickup extension

      I correctly configurated the extension but i don't received the notifications in my bot when a task has an update. Can you help me?
    • Waterfall Chart

      Hello, I would like to create a waterfall chart on Zoho analytics which shows the movement in changes of budget throughout a few months, on a weekly basis. Should look something like the picture below. Does anyone know how to?
    • How to associate email with record?

      Is there a way in Deluge or with the API to associate an email to a custom module record? I'm using the v2.1 Send Email method so I have the message_id of the email but don't see a way to add that to the Emails section of the custom module record because
    • 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
    • Private Project

      Hi, I would like to know if a user can create a Private project that only he's able to see it. Not even the ADMIN user. Thanks
    • Matching ZOHO Payments in Banking

      Our company has recently integrated ZOHO Payments into our system. This seemed really convenient at first because our customers could pay their account balance by clicking on a link imbedded in the emailed invoice. Unfortunately, we can't figure out how
    • The Social Wall: January 2025

      We're excited to get started with this year's monthly product updates through The Social Wall. Let's make 2025 a year filled with excited things to learn and explore. This month, we made some product enhancements in Zoho Social: Publish images on TikTok
    • 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
    • Write off bad debt

      Anyone know how to write-off bad debt in Zoho Books? I keep reading that there's a write-off option, but I don't see that option. Is there any other way to do this?
    • Related Record Bug

      Hi, Report a bug. Related record amount currency will display default currency (AUD) not the actual one (CNY). While if we click into the record and back, the currency will change to CNY (Correct). Then If we refresh browser, currency still show AUD
    • Change Currency symbol

      I would like to change the way our currency displays when printed on quotes, invoices and purchase orders. Currently, we have Australian Dollars AUD as our Home Currency. The only two symbol choices available for this currency are "AU $" or "AUD". I would
    • Creating Email template that attaches file uploaded in specific field.

      If there's a way to do this using Zoho CRM's built-in features, then this has eluded me! I'm looking to create a workflow that automatically sends an email upon execution, and that email includes an attachment uploaded in a specific field. Email templates
    • Cannot Forward an email to a New contact

      Hello, As the title says, I Cannot forward any email to a new contact. In fact the autocomplete feature brings old or even deleted contacts and simply does not recognize the newly added contact. Those new contacts have definitely already been added to
    • New Module in Portals wont Edit

      I created a new modular in the CRM and put a sub-form in it for costing projects. It opens in Portals, and Portals has the Edit option turned on, but it won't let me edit the module in Portals after saving. Anyone know why this would be happening?
    • Multi-currency in Zoho CRM Forecast and Reports

      As a company we have branches in 4 different countries with as many different currencies. Our Sales Teams would like to work with their local currency as much as possible. The Forecast module using only 1 currency is practically usable only by the sales
    • 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,
    • The dark mode in CRM is here!!!

      Just by accident, I discovered that CRM now has the dark mode! I'm sooooo stoked! I tried so hard with various dark-mode Chrome extensions to make the huge database that I'm staring at all day look easier on the eye! Some work ok, but there were always
    • Subform Zoho Form to Creator

      Hi, I would like to be able to retrieve the values of a Zoho Form subform to create an entry for each in Zoho Creator. To send from Form to Creator, I use Zoho Flow. I have a custom function, which should normally retrieve each field value then create
    • Email Verification on Subdomain

      Hi, The latest guidelines for setting up an email newsletter are to set it up on a subdomain of your main domain so that if you get put in a spam block, it doesn't block all your company email. We have been trying to set this up and managed to get our
    • 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
    • Is there anyway to get the columns to auto resize to the screen width?

      Hi, Is there a way of getting the columns to fit on one page in a creator app so it is easy to follow for the user.
    • Flow Error

      Hi Zoho Team, Any idea on this? This happens recently. Zoho Desk says "You are not authorized to access this resource."
    • Virus Scan Failing on Attachments

      Hi, Is anyone else having an issue with attachments being unable to upload? Virus scan takes forever and then fails, or just fails and says try again later Thanks
    • YET ANOTHER BUG: Client Script Flyouts no longer acting like Flyouts

      As per https://help.zoho.com/portal/en/community/topic/kaizen-157-flyouts-in-client-script one of the key benefits of a Flyout over a Popup is the ability to move it around the page. This no longer works. The "width" and "height" configuration settings
    • Global Subforms

      Hey 👋🏼 We have a few subforms to calculate detailed offers for customers of car dealerships. These subforms are used in different modules and we need to create snapshots of them in different cases for documentation reasons. For example, an approved
    • Migration not working

      I cannot set up a new email migration, this is the message: Oops! Something went wrong. Please contact support@eu.zohomail.com Can someone please suggest a fix?
    • [ADMIN CONSOLE BUG]: Selected users cannot be unblocked + cannot change user password

      Refer attachments: 1. Select users > click Unblock button > message keeps appearing at the top 2. Change user password > Click Change button > nothing happens
    • When an app is in stage, is any imported data save when its then published

      Hi, so I am just checking that any imported data during the stage part of app development wont be added when the app is published? Thanks.
    • Issue: Sales Order Not Closing After Converting to Invoice

      I am facing an issue while converting a Sales Order into an Invoice. Instead of using the original item from the Sales Order, I am removing it and adding it again from "Include Unbilled Items." However, after generating the invoice, the Sales Order status
    • Next Page