Kaizen #116 - Client Types in Zoho API Console

Kaizen #116 - Client Types in Zoho API Console

Hello everyone!
Welcome back to another post in the Kaizen series!

This week, we will discuss different client types available in Zoho API Console, and when to use each.

When you register an app in Zoho API Console, you typically choose a client type based on how your application interacts with Zoho services.
Let us discuss the available client types and how authorization is handled for each.

Available client types

  1. Server-based
  2. Client-based
  3. Self client
  4. Non-browser-based
  5. Mobile-based

1. Server-based

If you have a web-based application that runs on a dedicated HTTP server and interacts with Zoho services by calling Zoho APIs via that server, you must register your app with this client type.
This client type is for applications that redirect the users to another URL on a web browser to authorize themselves, where they give consent to your application to use their data.
In other words, you must use this client type when you have a front-end web UI and require user intervention before your app can access user data via the dedicated server.

Consider that you are developing a web-based custom application. Users authorize that app via browser to allow their Zoho CRM data to be accessed and used by that application.
During the registration process in Zoho API Console, you would choose the "Web-based" client type.
OAuth 2.0 would be used for user authentication, allowing your app to securely access and interact with Zoho CRM data on behalf of the users.

Here is a gist of what happens:
  1. Users visit your website where you have the Login with Zoho button.
  2. When a user clicks it, that user will be redirected to accounts.zoho.com with the details of your app such as client ID, scope, redirect uri, access type as the URL parameters.
  3. Your app must make an API call to Zoho Accounts with the client ID, scope, redirect uri, and access type. Users are shown the data that your application wants to use.
  4. When users give their consent, Zoho redirects them back to your app.This will be the "Redirect URL" you give while registering your app.
  5. The redirect URL will have the authorization code(grant token) as one of the parameters, along with the location(user's domain).
  6. Your app must then make API calls from your web server to Zoho Accounts to generate access and refresh tokens with the generated grant token.
  7. You must store these tokens in your DB to access that user's data in Zoho CRM. While making API calls, you must send this access token in the header.
  8. Your app must also have the logic to regenerate access tokens from refresh tokens when the access token expires.
Note that your app must take care of storing user's details like email, organization ID, and tokens.

The following image shows the protocol flow.


You can use any of our server-side SDKs to simplify this process.
When you use our SDK, all you have to do is, generate the grant token and initialize the SDK with the client details and this token. The SDK takes care of access token generation, refreshing it, and token storage.


For more details, you can refer to the Accounts guide and CRM help doc.

2. Client-based applications

This client type is for applications that do not have a server and run exclusively on a web browser.
This is also called the Implicit flow as your app makes API calls to Zoho only when users are using your app.
This type of application loads data dynamically on the webpage, and accesses Zoho CRM data by making API calls via Javascript.

Consider the same example where there is a Login with Zoho button on your webpage.
Here is a gist of what happens when a user clicks it.
  1. Your app redirects the user to Zoho Accounts.
  2. Your app makes the authorization request with the client ID, redirect uri, scope, and response type as token.
  3. The user is shown the data that your webpage would use.
  4. When the user gives consent, Zoho Accounts sends the access token to the redirect uri as a parameter, along with the expiry time and the location of user's data in Zoho's accounts server.
  5. You can include the "email" in your scope parameter in the access token request to get user's information. The response will have a parameter called id_token that will be in the header.payload.signature format. You need to decrypt the payload section of the parameter using the base-64 decryption algorithm to get user information.
  6. Your app must then make API calls to Zoho with this access token to fetch data.
  7. When the access token expires, your app must take care of regeneration and storage.


As the API calls are made from your domain to a different domain(zohoapis.com), for security reasons, the browser will throw the CORS error. So, your domain will be registered while registering your app, and Zoho will know to allow the API calls made from that domain.

As the tokens are available on the browser itself, we recommend handling them with care.
When you use our client-side JS SDK, it automatically generates a new access token upon expiry.

3. Self Client Applications

When your application does not have a redirect URL or a UI, but performs only a backend job, and does not need user intervention, then you must choose this client type.

A self client is often used when the application and Zoho services are operated by the same entity, and you want to enable secure communication between them. For example, you have an internal reporting tool and integrate it with Zoho Analytics. In this case, both the tool and Zoho Analytics are operated by the same entity.
Similarly, consider that you have a legacy product management system and want to perform data sync between Zoho CRM and the system, then you must use the self client.

Here is a gist of what happens.
  1. You register your app as self client in Zoho API Console.
  2. You will get the client details such as ID and secret.
  3. You provide the scopes required for your app to access CRM data.
  4. You will receive the grant token.
  5. Your app must then make API calls to Zoho Accounts to generate access and refresh tokens.
  6. Your app can then use this access token to make API calls to Zoho CRM and use data.
You can refer to our older Kaizen post on this topic for more details.
Note that self client apps can also use any of our server-side SDKs. As already said, the SDK takes care of access and refresh token generation, refreshing the access token, and token storage.

4. Non-browser applications

This client type is for devices that do not have a user agent such a web browser. A TV, for instance.
Let us consider an example involving a smart TV application that integrates with Zoho ShowTime. In this scenario, the smart TV application acts as a non-browser client.
Here is how authentication is handled:
  1. You must register your smart TV app in Zoho API Console with the type "Non-browser application".
  2. Users install a dedicated Zoho ShowTime application on their smart TVs.
  3. When users launch the Zoho ShowTime application on their smart TV, they are prompted to authenticate with their Zoho ShowTime account.
  4. When they successfully authenticate, Zoho Accounts sends the grant token to your app, along with the user-code, device-code and verification URL,The user must go to this verification URL on a browser and enter the user-code to grant permission to the app.
  5. Meanwhile, your app must poll the accounts server using the grant token to check if the token has been received.
  6. When the user enters the user code, Zoho Accounts sends the access token to your app.
  7. Your app can then use the access token to make API calls to Zoho. Your app must take care of token storage and renewals.

Here is the protocol flow. For more details, refer to this doc.


5. Mobile-based applications

You must use this client type when you have developed an app exclusively for mobile devices. The protocol flow is similar to server-based application where a browser session is required for the users to authenticate.



Similar to server-side apps, mobile apps also need to handle redirection, token generation and storage.
If you use any of our Mobile SDKs, the SDK itself handles token generation and storage.

We hope you found this post useful. Let us know your thoughts in the Comment section or write to us at support@zohocrm.com.


Cheers!


      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ




                                ご検討中の方

                                  • Recent Topics

                                  • Colour Coded Flags in Tasks Module List View

                                    I really like the colour coded flags indicating the status of the tasks assigned to a Contact/Deal in the module list view. It would be a great addition to have this feature available in the list view of activities/tasks. I understand you have the Due
                                  • Notes formatting

                                    I see that I can format this idea proposal with bold, underlines , colors, and dot points even multi-level dot points However, I cannot do the same for notes in leads, contacts, potentials, etc. in CRM. This makes notes very difficult to read. PLEASE
                                  • Linking records from different modules

                                    Hello, Is there a way to link customer call records from the 'Calls' module to specific account and contact records? I've realized that our customer meeting reports are linked to both the contact and the Account records, in related list fields but the
                                  • Quickly send emails and sync conversations with custom email addresses in CRM

                                    Editions: All editions DCs: All DCs Release plan: This enhancement has been released for customers in all DCs except IN and US. We will be enabling it for IN and US DC customers soon. [Update on 22 May 2024] This enhancement has been released for all
                                  • Business_hour (by minute)

                                    Hi Zoho Team business_hours formula can only give the difference of time or day between two dates. (In the time calculation, it can only calculate the exact time. For example, it can give the difference between 16:30 and 16:55 as 0.) I want to calculate
                                  • 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
                                  • Where do Review Questions appear on the Performance Assessment?

                                    Hi, I want to create a Performance Assessment including only compentencies with a multiple-choice format, and a final open-text question after the competencies asking for justification of the previous objective questions. Can Review questions work for
                                  • Exit details not linked on employee profile

                                    Dear Team, The exit details that were filled in are not appearing in the employee's profile, and it seems the data is missing entirely. Please advise on how to proceed. Regards, Preetika
                                  • Client Script: Any plans to add support for multi-select field with onChange

                                    Client Script is fantastic and the documentation lists multiselect form fields as unsupported. Just wondering if there are any plans to make this a supported field. https://www.zoho.com/crm/developer/docs/client-script/client-script-events.html 2. Field
                                  • Versioning of Quotes and Invoices

                                    Would be nice if Zoho Invoice would offer the feature of saving all versions of a quote or invoice during the process - so if quotes or invoices get changed over time - a version of the old ones exist and can be reviewed and reactivated if necessary ... ;)
                                  • Banking - User Roles - Access To Single Bank Account

                                    Hi, We have different locations with each location having a specific bank account for Expenses/Etc... Can you please confirm on whether it's possible to give a user (non accountant), specific access to only a single bank account as opposed to all accounts
                                  • 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.
                                  • Help! Unable to send message

                                    Help! Unable to send message I have this email sales<at>teadvancehydraulics<dot>com, but I couldn't send outgoing email. (Reason:554 5.1.8 Email Outgoing Blocked.) Can you please help?
                                  • CRM Mail merge issues

                                    How do you configure the page on mail merge, from ZCRM??. I have written a template and structured the filters. the print preview is on one page.  I merge the document.  The merge reformats and then the document formatting moves higher and higher until by page 5 you have two half letters!!!  Very frustrating. Does anyone know if I need to insert a page break or how to correct /format this so it doesn't happen?? Help.  L
                                  • 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
                                  • Power of Automation :: Auto update a custom field based on Parallel transition under Blueprint

                                    Hello Everyone, A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate
                                  • Push error with Zoho Books and Zoho CRM

                                    I have successfully linked Books and CRM but I have some push errors with the following message: "The customer associated to this record is not linked to module chosen in the current contact sync configuration." I am unable to work this out, could you help please.
                                  • Sales Tax Rates

                                    Why is the Tax Customization feature limited to 2 decimal points? This issue has been mentioned several times over the last few years but it has not been changed. From a programming stand point, this should be relatively easy. Third decimal point capabilities
                                  • Feature Request: Ability to copy notecards to Windows desktop

                                    Hello, Please consider adding the ability to copy notecards to Windows desktop. Thanks!
                                  • Add RSS Feed Feature to Zoho Desk Communities and Knowledge Base

                                    It would be very useful to be able to get updates on content which is relevant to me from Zoho Desk Communities through RSS and also push my own Zoho Desk Community content to other platforms through RSS.
                                  • Do Individual Forums within Categories, in Desk Community, Produce Their Own RSS Feed?

                                    Do Individual Forums within Categories, in Desk Community, Produce Their Own RSS Feed? If not, can anyone share a work-around that could help me get an RSS feed for individual category forums?
                                  • Add customer to account based on domain name.

                                    I generate reports based on a the account field, i.e. companyX. In GoToAssist, my last provider, there was an option to automatically assign new ticket creators to a company (or account) based on their domain name. So for example, if a new employee creates
                                  • Zoho One Apps is not populating once clicked

                                    Hi Support, The Apps Menu button (corner right next to my profile) is not loading. It keeps flashing but nothing is showing up. When I type quick in the search bar to locate quickbooks, it continues to flash with no apps shown. Thanks
                                  • Tablet Pencil + Fillable Form

                                    Hi There, I just started using Zoho Writer Forms for our team on iOS. I noticed that some functions support 'scribble' or tablet pens and some do not. Is there a function I am missing where any text field can support 'scribble' or handwriting/printing
                                  • CRM API v2 AdWords GCLID Parameter

                                    Hi, I'm using AdWords Integration with Zoho CRM using a third party webform and can't manage to insert the "gclid" parameter via Zoho CRM API Leads endpoint (version 2). I already checked the following articles: 1. https://www.zoho.com/crm/help/google-adwords/configure.html#Third_Party 2. https://www.zoho.com/crm/help/api-diff/ Form submission works fine. On server side the gclid is correctly included in API request. The Lead is created successfully. All fields (system and custom) are populated correctly
                                  • Zoho Writer can be slow to load sometimes

                                    Hello! I've noticed that whenever I restart my web browser (Firefox 2) and try to open Zoho Writer, it always shows the login screen first, even if I have an URL direct to the writing interface itself. I don't recall it doing this in an older version, so why does it happen now? Also, sometimes when starting Zoho Writer, it gets stuck: I see the word "Loading..." come up and the page half-extends but never fully loads. I have to refresh the page totally in order to get it to work properly, but doing
                                  • Mass email processes

                                    Hello, I'm looking to send about 7k emails out. I have them in CSV format with most being people I have previously communicated with. My questions are: * What is the process for using Zoho to send this group of emails out utilizing Microsoft 365 ? I'm
                                  • Zoho WorkDrive 5.0 : d’un outil vers une solution intelligente de gestion de documents

                                    Dans un monde de plus en plus orienté vers les données, les entreprises doivent non seulement gérer une masse croissante de données non structurées, mais aussi en extraire des informations stratégiques. L’intelligence de contenu répond à ce besoin en
                                  • Weekly Tips: Avoid any email mishaps using Zoho Mail's Email Recall

                                    Let's say you have just sent an important email to a recipient with an important attachment. Moments after hitting send, you realize the attachment is outdated and missing some critical updates. Sending another corrected version of the email without addressing
                                  • Messaging

                                    Whenever i send a mail to someone, it come with the my name of the company, instead of the name of my company.
                                  • Can't receive emails. MX Records are good apparently.

                                    Hello, For the past couple of days I have been able to send but unable to receive email through Zoho Webmail. I went into Admin Console and it says: MX Records are configured correctly and Your Domains MX Records are pointed to Zoho. Could you please
                                  • How can I customize my sales pipeline in Zoho.com CRM ?

                                    Hi to all intelligent community members I’m Namrata Hinduja Geneva, Switzerland, new member in Zoho.com and in this community. Please resolve my query - How can I customize my sales pipeline in Zoho.com CRM to track the progress of deals more effectively?
                                  • Error when adding phone number

                                    Hi Team, I'm getting an error when trying to authenticate using my phone, please see image attached. thanks, Jose
                                  • Zoho Projects iOS app update: Revamp of toast message and an option to view the whiteboard images

                                    Hello everyone! In the most recent Zoho Projects app update, we have brought in support for the following features: 1. Toast message revamp: We have enhanced the toast message banners to a bolder interface. You will now be updated on the progress of uploads
                                  • Send a new invoice data from Books to local certified solution via API json due local compliance

                                    Greetings, I hope you are doing well and staying safe. Due to local compliance regulations, I am required to issue invoices exclusively using locally certified software, which Zoho Books is not. However, we would like to continue using Zoho Books, so
                                  • How to Populate the Amount field of a Deal by subform's aggregate data

                                    https://help.zoho.com/portal/community/topic/custom-function-25-%c2%a0populate-the-amount-field-of-a-deal-by-calculating-the-number-of-related-products-and-its-unit-price I'm trying to do an Deal amount update like this guide but I use a subform to calculate the product amount and price instead. Please help me writing the code. regards
                                  • Unblocking Outgoing Emails on exports@carelyexport.com – Urgent Assistance Needed

                                    We are a newly established export-import startup operating under the business name Carely Export, and we are currently using Zoho Mail for our business communications. However, we are experiencing an issue where our outgoing emails are being blocked,
                                  • Property Management: Creating Amazing Appointment Scheduling Sites

                                    Sometimes a property management company can be very busy where even some time and effort saved can make a difference in a world. If you are a property manager, would you not like it if you could spend the wasted time managing appointments to get your job done? This is where getting a booking appointment platform lets you improve efficiency and save time. The enticing scheduling appointment platform can also help get more clients in than normal. It will help you contend with other companies that have
                                  • IP BLACKLISTED UCEPROTECTL3

                                    Your IP 136.143.188.56 was NOT directly involved in aabuse, but has a bad neighborhood. Other customers within this range did not care about their security and got hacked, started spamming, or were even attacking others, while your provider has possibly
                                  • Adding Public Holidays to the Calendar

                                    Hi, How do you add a public holiday to the calendar, we are closed on public holidays but if someone has requested holidays over that time how do we avoid the day being deducted as this is already a paid holiday? 
                                  • Next Page