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

      • How to normalize CRM module when integrating with Survey?

        This question is about the problem with many-to-many relationships and Survey. One of the things our organization does is track people in our program and their jobs. We get new information from the people three times annually through Zoho Surveys. Survey
      • Assign Vendors and customers specific branches ( location )

        Hi Team, Is it possible to assign specific customers/vendors to specific branches.
      • Currency Data Type Issue

        Hi, I'm running into an issue with the currency data type conversion with the pipeline tool inside Zoho Analytics. Basically, when the table is added to the pipeline, the columns with currency data type will be converted to text type. I assume it's because
      • VAT in Retainer Invoice -UAE

        It's currently not possible to add VAT to Retainer Invoices. UAE TAX LAW however makes VAT mandatory on each retainer invoice in UAE So basically, what i'm saying is that if you don't allow us to add VAT to Retainer Invoices, than the whole Retainer Invoices
      • Linking Multi-UOM Barcodes to Products in Zoho Books

        Greetings, I'm using Zoho Books for retail shop and I'm running into a bit of a challenge with products that have multiple Units of Measurement (UOMs) and corresponding barcodes. For example, I sell cigarettes both as individual packets and in cartons
      • Add SalesPerson PlaceHolder in Notification

        We have the ability to include only Created By But for my use case I need the sales Person in the Email as well And the subtotal as well Please give us access to Sales Person and Subtotal Placeholders
      • Using Equity Contributions To Fund Investments/Expenses?

        Hello! My partner and I just transferred over to Zoho Books and are trying to figure out how to adapt it to our business model.  We currently fund the company as individuals and utilize those funds to:  1) Cover OPEX 2) Invest in companies.  - I recorded
      • Showing ALL missing data

        Hi, When I create a chart, I noticed that even when enabling the "show missing values" option, if, let's say, the current time period will not show as "0" on the chart if there's no data (rows) in the table. For example, I have this data: Week 1: 0 rows
      • New Action Requests

        Hi, Is there any chances to get the new actions requested at all? I have made a few requests but never heard back from Zoho about them. I assume that developing them take time but is there any support that can provide some update? Thanks
      • Global Sets for Multi-Select pick lists

        When is this feature coming to Zoho CRM? It would be very useful now we have got used to having it for the normal pick lists.
      • Using tickets to train Zia

        Hi Team, I would like to know if there is any way that Zia can also learn from previous tickets in addition to the articles from the knowledge base. Since we have most of our knowledge curerently in the tickets and that this is hard to combine into a
      • Validation Rules Trigger on Untouched Fields

        In Zoho Desk, validation rules trigger for ALL fields during an update—even fields that weren't modified in the current edit. This behavior is fundamentally different from Zoho CRM and other Zoho products, where validation rules only apply to fields actually
      • Same users on different accounts

        I have an issue I need help with. Whilst trialing ZOHO CRM I created the following: Account1 using myname@myorganisation.com.au and 2 personal emails Account2 using a personal email and 2 users sales1@myorganisation.com.au and sales2@myorganisation.com.au
      • Kanban Deals not showing everything

        I have a deals (I call it Opportunities) module in CRM that shows various components of the opp. I'm trying to have a checkbox show up for the end user to be able to toggle it if they want an email to be sent when the change stages (in this example, it's
      • Custom Function : Copy multilookup field to text field

        Hi, I'm a newbie on function programming, I try to copy text from a multi lookup field named "societe" to a text field named "societe2". I've used this code. In deluge script it seems to work, but when I trigger this function it doesn't work (Societe2
      • Zoho CRM's V8 APIs are here!

        Hello everyone!!! We hope you are all doing well. Announcing Zoho CRM's V8 APIs! Packed with powerful new features to supercharge your developer experience. Let us take a look at what's new in V8 APIs: Get Related Records Count of a Record API: Ever wondered
      • How to automatically go to the bottom of a Zoho spreadsheet when opening the file

        Is there a way to open a Zoho spreadsheet and have it automatically go to the either the bottom row that contains any sort of text or formula?   It would work fine if it simply went to the "lowest" row for Column A that contains information.  I do see you can use the URL to go to a specific cell (and probably a named cell as well) but I haven't found a way to do what I'm asking.  The spreadsheets are fairly dynamic and information is added to them frequently.   Another thing that would work would
      • How to overcome Zoho Deluge's time limit?

        I have built a function according to the following scheme: pages = {1,2,3,4,5,6,7,8,9,10}; for each page in pages { entriesPerPage = zoho.crm.getRecords("Accounts",page,200); for each entry in entriesPerPage { … } } Unfortunately, we have too many entries
      • What are the knowledge database limit for AnswerBot and which app its integrate?

        1) Can AnswerBot be integrated in Trainer Central? 2) Can AnswerBot learn from external websites and excel spreadsheets? 3) Is there a limit size or number of documents for the knowledge based content to train AnswerBot? Thanks
      • Comment gérer vos colis et expéditions dans Zoho Inventory

        La logistique a évolué afin de permettre l'optimisation des commandes à travers la planification et l'exécution - de la réception de la commande à la livraison. Un système de gestion des colis présente plusieurs avantages. Livraison dans les délais prévus
      • Have you checked your Email headers for DKIM Failure?

        Have you taken a look at your email headers for DKIM failures even with DKIM set up properly? I've had DKIM successfully set up for many months. My account currently shows Email Verified and Authenticated. Big green check marks. Email Relay is also showing
      • Add more than 7 sender addresses in campaigns

        I need to add at least 15 sender email addresses but am currently limited to 7. Please can you increase. Thank you
      • How to avoid outgoing emails from Zoho CRM from being treated as SPAM/Junk when arriving in an Outlook Inbox?

        I just upgraded to Zoho CRM paid version so I could use the Mass EMail feature using a simple email template I prepared.   When testing this feature out, I sent emails to my Yahoo, GMail and to an Outlook EMail Inboxes.   Yahoo & GMail received the messages fine.    I have attached a print screen from my Outlook "Junk Folder" that shows the error message and note that at the bottom of the screen, it is obvioius that ZohoCRM's mail server is noted in the email's header/footer.  BELOW is the last few
      • Automate pushing Zoho CRM backups into Zoho WorkDrive

        Through our Zoho One subscription we have both Zoho CRM and Zoho WorkDrive. We have regular backups setup in Zoho CRM. Once the backup is created, we are notified. Since we want to keep these backups for more than 7 days, we manually download them. They
      • Managing two books in Zoho Books

        is it possible to effectively manage two separate books within Zoho Books? My organization is considering handling accounting for two distinct subsidiaries, and we would like to understand the best way to achieve this within the Zoho Books.
      • How to get custom estimate field to display on existing or new services?

        I am using FSM. I recently added a new custom field to Service Details to help categorize my services. I can see the newly added field as a column on the service list view. However, when attempting to update an existing or create a new service, I don't
      • Popup or Highlight on the Form based on a comparison

        I have a field for Engine Odometer, and a field for next oil change in KM. Is it possible to generate a popup, or highlight the form, if the Engine Odometer number is larger than the next oil change in KM number?
      • Remove the dot menu and + sign on sub form

        If I don't want the user to be able to add more entries on a subform, am I able to remove the dot menu and the + sign?
      • Allow Zoho form to send to one of our ogranizations groups

        All emails from the form submission are being held for moderation. I have permissions set to organization members, and I think I have the forms setup in our DMARC
      • Disable fields in multiple subform rows

        Hello everybody! I have an odd one here. I have a subform that collects hours of operation. It contains these fields: Days, Type, Open, and Closed. On load of the form I add 7 rows with Mon - Sun in the Days field. I then disable that field and the add/delete
      • Change Last Name to not required in Leads

        I would like to upload 500 target companies as leads but I don't yet have contact people for them. Can you enable the option for me to turn this requirement off to need a Second Name? Moderation update (10-Jun-23): As we explore potential solutions for
      • to close auto payment system for renew my subscription. and get refund my deduct money.

        please consider and refund my money.
      • Lookup field display in Zoho Analytics

        Hello, I think I am missing something very obvious, but I can't figure it out: I have 2 lookup fields in my "Deals module" -> One for the account that we have the project with and one for the beneficiary account. Both fields refer to the "account name"
      • Unified customer portal login

        As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
      • Writing Checks to Employees for Reimbursable Expenses

        I couldn't find a way to write a check through books or expense to an employee for reimbursable expenses. The expense created an entry in the system with a debit (expense) credit (liability). I entered a bill and used the liability account so it would
      • Best way to automate quotes in CRM

        I am trying to take specific information from prospects/clients through Zoho Forms (contact info, square footage, surface area, etc.) and auto generate quotes based on the information submitted.  Ideally, the quote would be sent immediately after the form is submitted. I know Zoho has a few different ways to achieve this and wanted to know if there was a 'best practice' for automating the quotation function within CRM. Or if there was another app that can perform this functionality better (Zoho Commerce,
      • Sync Creator form submissions to WorkDrive folder

        I've made 10 Creator applications, and need to sync my each application's submissions into a WorkDrive folder. I need the form submissions to be PDF file type and sync to a specific folder for documentation purposes. I have tried to use a workflow, but
      • ZohoOne suite

        Hi, i am trying to set service for managed service offerings, I was wondering if there was a way to manage that? I would be the service manager and have a company I would be managing as well. any help would be much appreciated. I have seen that different
      • Share passwords/secrets and folders/chambers with external users

        Currently you allow sharing passwords with internal users, internal user groups, and third parties. The third party feature gives temporary access of 30 minutes and it does not have any sign up. What we really need is to properly share secrets/passwords (and ideally folders/chambers) with Zoho Vault users that are not part of our organisation - even if they are on the free plan. If they accept the share, the password would be stored in their Zoho Vault as long as I maintain the share. If I revoke
      • View Kanban tasks in "Status" layout for all projects

        Hi I'm testing Zoho Projects Express to see if it is suitable for my business. So far it looks great and seems to do everything we want (except critical path on the Gantt charts), but one thing I can't seem to figure out is this: If I go into a project, and choose "Kanban", I can select the "Status" layout which is great. I can see the status of all of the tasks in that project, and who is working on what. However, if I go to: Home > My Tasks > Kanban, then the "Status" layout isn't an option - only
      • Next Page