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

    • Cross-department Parent-Child ticketing for faster and efficient ticket resolution

      Hello everyone, Organizations frequently need to have multiple departments set up in their customer service ticketing system. However, when a customer raises an issue or an internal process that requires agents to collaborate with their peers, a lack
    • Can't setup email on outlook (Android Phone)

      Dear All Support, I have tried many time to setup this zoho mail over the android phone (outlook app) . But it's always show me to check username/password of my email . But i can login from the webmail , that's why i confuse , How can i able to access
    • Having problem with MX records and SPF

      Hi there, I have been facing a problem that my zoho mail doesn't receive mail. See Error in below The MX Records of your domain(s) mydomain.com are not pointed to Zoho and you may not receive emails in Zoho SPF entries in your domains DNS are not configured
    • ZOHO Mail App Not working

      There seems to be an issue with Zoho Mail App today. It is not connecting to server, internet is working fine, tried uninstalling app and reinstalling, loading circle keeps spinning round. Is there an update on the way?
    • Account with own domain, IMAP vs IMAPPRO

      Hi, I have email account with my own domain. I use Em Client email plan and when I use IMAPPRO incoming host, email comes in Em Client only when I restart program. If I use IMAP incoming host everything is ok. Port is 993 both option. Why so? What´s different
    • Automatic Display the Price from CPQ

      Is it possible to display the discounted price from CPQ that I created for my customer? For example, when the customer selects Product A, instead of showing the default price, it should display the discounted CPQ price.
    • Enhancement - Financial Reports

      Hello Everyone, As part of enhancing reports in Zoho Books, we have added an option`Compare With` in Financial reports. Using this, you can compare the current period with Previous Year(s)/Previous Period(s) (Maximum 3 periods). This option is available in the following Financial Reports: * Profit and Loss * Cash Flow Statement * Balance Sheet Please feel free to share your feedback.  We are glad to hear from you. Regards, Nithya - Zoho Books Team.
    • Associating Multiple Work Orders with a Single Invoice in Zoho FSM

      Hello Everyone, Is it possible to associate multiple Work Orders with a single Invoice in Zoho FSM? Best Regards, Subhash Kumar
    • Sent emails not going and showing "Processing"

      Hello Team, Could you please assist with sent emails showing "processing" and not actually going through? Many thanks and regards, Cycology
    • Free Plan mail accounts details

      In the zoho mail pricing there's a free plan that includes: FREE PLAN Up to 25 Users 5GB* /User, 25MB Attachment Limit Webmail access only. Single domain hosting. I need to make sure that I'm able to create multiple email accounts in the form of: name@domain.com
    • Spf cannot verify

      Hello, Thank you for your service. I am not able to configure my SPF. I have follow several times your instructions but it does not work. I cannot verify. My domain is ptjpt.co.id Please help me
    • 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
    • Introducing Global Sets for easy management of similar picklists in CRM

      [Update | Sep 2024] We've increased the maximum count limit for global sets. These new limits are now live for AU and JP data centers and will be gradually opened to all. Please check this link for the updated limits. Hello folks, As administrators who
    • TikTok (and other social platform) Messages and comments of the past

      When I link a social channel, Zoho will show in "Inbox", "Messages" and "Contact" sections the interaction done in the past? (comment, messages...)
    • Announcing Zoho Community Developer Bootcamps in India – Extensions

      Hey everyone! We're back with another line-up of Zoho Community Developer Bootcamps in India! Following the success of the first leg of bootcamps on Extensions, we're now ready with the second leg. These bootcamps focus on empowering developers of all
    • Unable to send message:mail rate exceeded limit

      Hi Admin I just got an email that outgoing has been blocked, I know why is the reason said " Mail rate exceeded limit", but I don't know the rule of Mail rate , so please tell me how to avoid the situation and fix this issue , my email id is morgan@homemesh.com.tw.
    • Error when using fetchById in Client Script

      When using client script when creating page (onLoad), I suddenly getting error "Cannot read properties of undefined (reading 'Accounts')" when using: var account_details = ZDK.Apps.CRM.Accounts.fetchById(account_id); I'm getting this error whenever trying
    • Los correos que envio, llegan como spam (Bandeja de correos no deseados)

      Estimados, Buenas tardes, necesito su soporte, los correos que envío desde mi cuenta llegan como spam. (no deseados). ya sea hacia cuentas de hotmail, gmail... etc.. El dominio lo tengo alojado en nic.ar (argentina). Por favor, necesito resolver esto
    • Zoho say my domain seems to be already associated with another account

      I created a website on zoho and associated my domain (bompescado.com) on it. You can see the A record and CNAME are working to it. Now I need to associate the same domain as webmail, but when I try it return with: " This domain name seems to be already associated with another account. If you own this domain, please contact us for assistance." Im following the advice and conctacting you to say I've not been associated this domain on zoho before.  What do I need? Well, I need you manually remove it
    • Zoho Mail Not Receiving or Sending Email

      My zoho mail is not sending or receiving mail. What's the fix for this?
    • Cannot add new mail client

      Hi Guys, I've just got a new laptop and am trying to set up Outlook to connect to my Zoho account. No matter what I do, I cannot connect I'm using IMAP for incoming mail, it's enabled in my account settings, and I'm using the setting shown on the account
    • Zoho Payroll: Product Updates | April 2025

      At Zoho Payroll, we’re always working to make every payday feel effortless. And sometimes, that means listening closely to your unique needs. This month, we’ve focused on adding features that give you the flexibility to pay your employees based on your
    • Zoho CRM to Zoho Projects Workflow {"error":{"code":6831,"message":"Input Parameter Missing"}} connecting

      void automation.Untitled_Function(String ProjName) { resp = invokeurl [ url :"https://projectsapi.zoho.com/restapi/portals/" type :GET connection:"zohoprojects" ]; info "Portal API Response: " + resp; portalId = null; if(resp != null) { if (resp.containsKey("portals"))
    • Zoho mail Virus Scan Virus Detected (but I checked it with VirusTotal)

      Dear all, since this morning we can;t send any attachments out. Zoho says there is a virus in it, but clearly there is not when I checked the file on VirusTotal.com. Please help us out!
    • Cant receive emails

      Hi, I just created an account and went through all steps. Everything has been set up from my end, but Ive sent a test mail to the newly created email address, but it never arrived. Can somebody please help me? Thanks!
    • How do I fix this? Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked.

      How do I fix this? Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked.
    • Multi-column sorting

      Is multi-column sorting a planned feature for CRM? We are needing to sort by one column and then subsort by another column. I am just wondering if there is a planned feature that will allow this?
    •  【Zoho CRM】サブフォーム内にあとから追加した数式項目を一括して計算させる方法

      皆様のお知恵を拝借いたしたくご相談させてください。 【状況】 任意のタブにすでにサブフォームが設定されており、そのサブフォームを含め、既に数千件のデータが存在している。 【実施したいこと】 新たに数式項目をそのサブフォームに追加して、入力済データのレコードも含めて、その数式項目の計算結果を反映させたい。項目の更新で数式項目をサブフォームに追加しただけでは計算されません。 【わかっていること】 任意のタブのサブフォーム外にあとから数式項目を追加した場合、数式項目を追加しただけでは当然数式項目の計算結果は反映されませんが、以下の方法を実施すると数式項目が計算されます。
    • My Zoho Mail Account Has Been Blocked for Sending Email - Block Type: Mail Outgoing blocked

      Hi everyone... My Zoho Mail account has been blocked for long time... Until now, I cannot sending outgoing email. I was already try to contact Zoho customer support, but there is no reply from them. This is notification which appear on my zoho mail account...
    • Task reminder with custom function

      Hello! I am trying to create a custom function to add a task. With you guys helping, I could create a function but I could not set the reminder. Anyone knows how to add a reminder?  Thank you for your tips!
    • Announcing new features in Trident for macOS (v.1.18.0)

      Hello everyone! Trident for macOS is here with interesting features and enhancements to elevate your workplace communication and productivity. Let's take a quick look at them. Retract sent emails. Whether you've missed adding an important attachment or
    • Zoho Books GST enabling issue.

      Without knowing I have created a Branch in Zoho Books, Now I am trying to enable GST option but is disable? Is there anyway to enable the GST Button?
    • Add a Calender view in Zoho CRM

      I would like to ask if it's possible to add a calendar view to a custom module in Zoho CRM. Is this feature planned for future development? It would be extremely helpful for us. I’d like to allow my users to view the data visually in a calendar layout,
    • Make the edit fields hover in Canvas View look the same as the Detail Page

      The edit field UI in the Canvas View is not consistent with the standard detail page UI. For some modules we have Canvas views, for some we don't. We don't want it to look differently. We want it to look like one system.
    • Validating an order by a superior

      Hi, I have a very specific use case for Backstage. Let me know if this is possible or how I could get around this (or if there are no workaround). One of my client uses Backstage to manage internal (on site) events. Participants from different departments
    • iOS App Version 3.0 - Customer list gone?

      Not sure when this changed, but I seem to have been updated to 3.0 for the phone app (on iOS). I'm pretty sure that I used to have a Customers button that allowed me, for example, to see what appointments a customer has. Has this disappeared or am I just
    • Can't Find or Use Saved Replies in Inbox Module

      I'm an Admin user on Zoho Social, and I've created a few saved replies under Inbox Preferences > Saved Replies. However, when I go to the Inbox module to respond to a message, I don't see any option to insert or use saved replies. I've checked that: I'm
    • Episode II: Begin Your Automation Journey in Zoho Desk with Deluge

      To travel to another country, you need a passport. But that's not enough, you also need a visa, flight tickets, and, most importantly, a mode of transportation. Without these, your journey cannot begin. Similarly, custom functions in Zoho Desk are essential
    • How can I capture the Cliq channel name from Deluge Script?

      I am working on a chat automation with a third party tool called Make.com. Using a webhook I am relaying information from the Bot I have created in Zoho Cliq to Make.com Webhook. I am using the Mention Handler of the bot in Cliq to relay information like
    • Introducing Zoho CRM for Everyone: A reimagined UI, next-gen Ask Zia, timeline view, and more

      Hello Everyone, Your customers may not directly observe your processes or tools, but they can perceive the gaps, missed hand-offs, and frustration that negatively impact their experience. While it is possible to achieve a great customer experience by
    • Next Page