How to call Zoho CRM APIs using Client Script

How to call Zoho CRM APIs using Client Script



Welcome back to another exciting Client Script post!
In this post, we will discuss one of the most frequently asked questions: How do you call Zoho CRM APIs from Client Scripts?

In this kaizen post,


1. Ways to make calls to Zoho CRM APIs using Client Script
      1.A  Client Script ZDK CRM APIs
      1.B. Using Connections
2. Requirement
3. Solution
      3.A. Create a Connection
      3.B. Invoke API using Client Script
4. Summary
5. Related Links



1. Ways to make calls to Zoho CRM APIs using Client Script

1.A  Client Script ZDK CRM APIs 
  • You can use the available Client Script ZDK CRM APIs to call v2 APIs directly from within your Client Script. 
  • To view this documentation, click on the help icon next to CRM API in the Library Section of the Client Script Editor. Here is how the screenshot of the documentation looks.


1.B. Using Connections

For calling other Zoho CRM APIs(other than the APIS covered in Client Script's ZDK CRM API) or third-party services, you will have to use Connections along with Client Script. In this post, let us see how to call Zoho CRM APIs. Check the Kaizen post on Third Party Integration using Client Script to know how to call Third Party APIs from Client Script.

2. Requirement

To retrieve all open deals for the currently viewed account.

3. Solution

To fetch app open deals for an account, you can use  COQL API. You can also use the Related Records API, get deals of a given account ID, and then filter the open deals.
But COQL API is recommended due to the following reasons.
- There is no indexing delay.
- You can use comparators such as is null, is not null, between, in, not in, like, and not like in your search query.
- You can fetch data from other lookup modules if any. Click this Kaizen Post for more details.
To accomplish this requirement, create a connection with the scopes for the API you want to call and create a Client Script

3.A. Create a Connection
  • To setup Connection, follow the below steps.
  • In Zoho CRM, go to Setup → Developer Hub → Connections and click "Create Connection".

  1. Select Zoho OAuth in Default Services and click "Create and Connect".

  • Specify a name for the Connection and select the Scopes required for COQL API.
ZohoCRM.coql.READ (and) ZohoCRM.modules.READ
(or)
ZohoCRM.modules.{module_name}.{operation_type}

  • Click Create and Connect.


3.B. Invoke API using Client Script
  • Go to Setup → Developer Space →Client Script. Click +New Script.
  • Specify the details to create a script and click Next.

  • Enter the following script and Click Save.

  1. var acc=$Page.record_id;
  2. var parameters = {
  3. "select_query": `SELECT Stage,Account_Name.id from Deals where Stage not in ('Closed Lost','Closed Won','Closed - Lost to Competition') and Account_Name.id = ${acc}`
  4. };
  5. var response = ZDK.Apps.CRM.Connections.invoke("test", "https://www.zohoapis.com/crm/v6/coql", "POST", 2, parameters, {});
  6. log(JSON.stringify(response));
  • You can invoke COQL API using Connections in Client Script using invoke() method.


Click here to know more about the Connections.
Here ,
  • Connection name is test
  • url is https://www.zohoapis.com/crm/v7/coql
  • method is POST
  • param_type is 2
  • parameters is the query stored in parameters variable.
  • headers - there are no headers in this case.
Summary

In this post we have discussed the following.
1. How to call COQL API using Client Script 
2. Steps involved to include the scopes via Connection
3. Advantages of COQL API


    • Recent Topics

    • Allow non admins to create folders

      I want to allow users in my company to create their own reporting based upon selected Datasources, however they currently can't create folders to save their work in. This can only be done by admins, which seems excessive. Is this possible ?
    • Filter a report for a specific bank and a specific transaction type (interest income)

      I am trying to run a report - any report - on a specific bank account for the interest income. I do not see it as an option. I can see the Bank Account under Account in the Filters, and I can see the Interest Income under Account in the Filters But I
    • Lookup fields can't be used for anything important

      Hi It seems the lookup fields are mostly.... informative, you can at most link stuff between modules... You can't use lookup fields in blueprints, you can't use them in layout rules or anything... It that correct?
    • Sync desktop folders instantly with WorkDrive TrueSync (Beta)

      Keeping your important files backed up and accessible has never been easier! With WorkDrive desktop app (TrueSync), you can now automatically sync specific desktop folders to WorkDrive Web, ensuring seamless, real-time updates across devices. Important:
    • I don't really understand leads in the campaigns tab on Zoho CRM

      Good morning, fellow CRM users. I am having quite a hard time understanding the leads in the campaigns tab. In this particular campaign in the screenshot below, we sent out emails to our mailing leads through Zoho Campaigns, and the data is linked back
    • What’s New in Zoho Inventory | April 2025

      Hello users, April has been a big month in Zoho Inventory! We’ve rolled out powerful new features to help you streamline production, optimise stock management, and tailor your workflows. While several updates bring helpful enhancements, three major additions
    • Error: Unable to save integration in Desk

      Hi, Problem here. When I try to integrate Zoho CRM with Zoho Desk, I get an error when saving: Unable to save integration in Desk. See print screen below. I'm selecting the right accounts and fields, so not sure what's going wrong.
    • Leads Should Support Business-Centric Structure for B2B Use

      We’re a B2B company that generates leads for other businesses and often engage with multiple contacts within the same company. For years, we’ve struggled with Zoho CRM’s limitation of requiring a Last Name field for leads. For example, if we’re pursuing
    • New notecards not syncing across devices

      Hello. I just noticed this problem happen recently. A new note being created on one device is not appearing on a different device, even though they're supposed to be synced with each other through setting it up on your account. I don't know if there's
    • Invalid URL error when embedded sending url into iframe for my website when using in another region

      Hi team, My site is currently working on integrating your signature feature as part of the system functionality, it's working great but recently there's been a problem like this: After successfully creating the document, i will embed a sending url into
    • Zoho AI Translate – No Support for Hebrew?

      I want to use Zoho AI Translate, but I see that it does not support Hebrew. Since Zoho supports multiple languages, I was hoping this function would also work with Hebrew. Is there any plan to add Hebrew support in the near future? Or is there an alternative
    • Trying to integrate gmail but google keeps blocking Zoho access for integration??

      hi i am trying to integrate a gmail account so can track/access business emails this way. I have followed the instructions but after selecting my email account it gets re-routed to this message (screengrab below) Can anyone advise a way around this or
    • 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
    • This mobile number has been marked spam. Please contact support.

      Hi Support, Can you tell me why number was marked as spam. I have having difficult to add my number as you keep requesting i must use it. My number is +63....163 Or is Zoho company excluding Philippines from their services?
    • How to mass update member status in a CRM Campaign?

      Does anybody knows how to mass update member status of the contacts (or leads) associated to a campaign. I can click on a campaign record and go to the Contacts in the Related List fields but then it shows only 10 contacts per page at once. It is hard
    • Sendmail based on individual subform rows on form submission

      Salut, My order form has an product subform with items that can be bought from different suppliers. I would like every suppliers to receive an email saying "you have an order" with all items (records) of the order associated with them. The suppliers'
    • Turning off the new UI

      Tried the new 'enhanced' UI and actively dislike it. Anyone know how to revert back?
    • Where to find User Performance Page in CRM?

      Hi all Just googling answers to another forum post I've just put here when I found this page; https://help.zoho.com/portal/en/community/topic/forecast-performance-analysis-public-early-access-2023 It shows this User Performance Page screenshot. I can't
    • How to create Comparison across Period chart in a dashboard?

      Hi all How can I create this chart in a custom dashboard? The issue for me is that this chart is very small. The CRM module (unlike Projects module) has no ability to expand a chart. I want to make it larger, but also want to include it in a custom Forecast
    • Can't attach a file with ZOHO Mail

      I am a new user of ZOHO mail.  The attachment feature of the mail does not work.  I get the dialog box to choose the file, then nothing happens and it does not attach the file.  Please fix.
    • Out of Office not working

      I have set up out of office on zoho mail, however, it does not reply to every mail sent to it. I have tested it by sending several test messages from multiple different email accounts, I will get a response to some of them, but not all of them this is
    • Automating Employee Birthday Notifications in Zoho Cliq

      Have you ever missed a birthday and felt like the office Grinch? Fear not, the Cliq Developer Platform has got your back! With Zoho Cliq's Schedulers, you can be the office party-cipant who never forgets a single cake, balloon, or awkward rendition of
    • Gmail to Zoho Mail: Filters

      I'm considering a switch from Gmail (using its Workspace with a custom domain) to Zoho Mail. Reading the tutorials but didn't find the info on Gmail's filters. I have tons of them to auto-label my incoming emails. I know that those labeled emails will
    • Removed email address - can't access account

      Hi Zoho Support Team, I recently removed my email address from my Zoho Desk account (which is part of our organization's Desk setup) and then signed out. Now, I’m unable to log back in because there is no email address associated with the account, even
    • I am Getting All visitors Location United Arab Emirate on Zoho sales WHY

      Hi, I am getting all visitors location United Arab Emirate this is wrong people come from Dubai Sharjah Ajman as well
    • how can I change the font when I answer a ticket in zoho desk? thanks

      how can I change the font when I answer a ticket in zoho desk? thanks
    • Unveiling Cadences: Redefining CRM interactions with automated sequential follow-ups

      Last modified on 01/04/2024: Cadences is now available for all Zoho CRM users in all data centres (DCs). Note that it was previously an early access feature, available only upon request, and was also known as Cadences Studio. As of April 1, 2024, it's
    • Custom Serial numbers in Inventory tied to customers

      Hello, We have both software and hardware serial numbers that we need to track for active customers in the field. We do not know the serial numbers for the software until the customer buys it as its not a stock item but something we order and deploy for
    • How to nurture leads, manage contacts and grow your B2B business with SalesIQ?

      Zoho SalesIQ is one of the most powerful support tools in the industry and is preferred by millions of customers. SalesIQ is used to acquire leads across various sectors and automate your workflows. The all-new SalesIQ brings more power to your business
    • Contracts Management

      Hello, We are implementing Zoho FSM for our field service operations and, one of the features we are lacking is Service Contract Management. I was told that such feature might be in the pipeline but an estimated launch date for this is not available at
    • One notebook is on my Android phone app, but not on Web or PC app.

      This problem started in stages. At first my phone was occasionally failing to sync. Then I noticed two things added to my Phone App. One was an existing notebook had a new cover, and the other was a new Note Card with an odd text in it. These were only
    • Does Thrive work with Zoho Billing (Subscriptions)?

      I would like to use Thrive with Zoho Billing Subscriptions but don't see a way to do so. Can someone point me in the right direction? Thank you
    • Is it possible to add HTML or a button on email templates in Zoho Desk?

      Hello team, I am working on getting the best use out of Zoho Desk. I have noticed that when you hit 'reply' on a ticket, it comes with a small 'survey' to the recipient saying something like 'how would you rate your experience with us?'... so my question,
    • Is it possible to add buttons on email replies to internal team members?

      Hello everyone, I am currently trying to set up some workflow rules to trigger when a ticket is created. I have noticed there is a button that can be added to email templates when sending email alerts from workflow rules, for example ${Cases.SUPPORT_PORTAL_BUTTON}.
    • What is the use of the stage environment ?

      Salut, I am woundering what is the use of the stage environment. Usually, I do all the testing in developpement, and then go straight to production. The only thing I cannot test in developpement, is the result for portal users. Could the stage environment
    • Peppol Malaysia API

      Hi Zoho Books, my country Malaysia will going to implement "Peppol" (E-Invoicing), starting 1 Jul 2025 for all businesses. The government intends to provide API for accounting app. The workflow involves creating an invoice from accounting app, triggers
    • At transaction level Discounts for Zoho books UAE version

      Dear Team, Please add transaction level Discounts for Zoho books UAE version. I have been requesting Zoho team past 3 years, Transaction level Discounts is a mandatory option required for our business needs. Zoho books Indian version has the option then
    • New in CRM: Dynamic filters for lookup fields

      Last modified on Oct 28, 2024: This feature was initially available only through Early Access upon request. It is now available to all users across all data centers, except for the IN DC. Users in the IN DC can temporarily request access using this form
    • Sales Order automatic Convert to Invoice using boolean True or false

      It is possible to convert the Sales order to an invoice using a boolean field, true or false Example: I create a field in my Sales Order, I name it QBO Invoice, and the field type is Boolean, true or false. Let's say the default is false, so when I change
    • Presenting the brand new Zoho Bookings!

      Hello everyone, Greetings from Zoho Bookings! We're happy to announce a new version of our product with enhanced features to simplify scheduling, coupled with a sleek interface and improved privacy across teams. Here's what you can expect from the latest
    • Next Page