Creating a Gmail integration using custom connectors

Creating a Gmail integration using custom connectors

Hello everyone!

Greetings from Deluge. Following up on our series aimed at exploring the capabilities of Deluge, today we'll take an in-depth look into the Deluge custom connections that can be created across Zoho services.

Deluge boasts an extensive range of over 260 built-in integrations spanning more than 35 Zoho services. These integrations streamline data access and modification with these services, from a single point in Zoho, without having to toggle between services. However, we understand that the needs of our users vary widely, and sometimes existing integrations may not cover every scenario.

That's where custom connections come in. Think of them as the Swiss Army Knife of integrations, enabling connections with hundreds of services—such as Gmail and Outlook—and seamlessly integrating them with your favorite Zoho services. With custom connections, you have the power to build your own integrations with virtually any third-party service and tailor them to meet your requirements. Moreover, since the custom connections use the OAuth 2.0 authentication mechanism, you're getting best-in-class security while integrating with third-party services.

What are connections? 
Before we dive into the details of custom connectors, let's take a glimpse at what connections are in Deluge. Connections are a means to connect your Zoho account and any third-party accounts you wish to integrate with. Once a connection is created and connected, you can use it in Deluge integration tasks or invokeURL scripts to perform REST operations on the target service from the required Zoho service. For more information, visit our Connections help doc.
  
Use case 
Assume the sales team of an organization uses Zoho CRM for managing leads, customer retention, and customer acquisition, and uses Gmail for communication purposes, like following up with potential clients via email.   While the system works as is, it's time-consuming and prone to error, so an integration between Gmail and Zoho CRM is necessary to improve efficiency.

A custom connection to your Google account will enable you to sync your Zoho CRM and Google accounts, allowing you to perform actions related to your Google account from Zoho CRM. For example, you can invoke the connection using the invokeURL task in Zoho CRM and send an email to your leads from your Gmail address.

Steps to configure the Google custom connection

Configuration video


Configuration steps
Creating Google OAuth credentials
  1. Visit https://console.cloud.google.com/.
  2. Click the dropdown and choose the required project.
  3. Navigate to the hamburger menu on the left and click APIs and services -> Library.
  4. You'll be taken to the API library page. Navigate to the Google Workspace section and click Gmail API.
  5. Next, click Enable on the Gmail API product details page.
  6. In order to use this API, you'll need to create credentials. Click CREATE CREDENTIALS.
  7. On the Create credentials page, choose Gmail API in the Select an API dropdown and User Data under the What data will you be accessing? section. Click Next.
  8. Next, on the OAuth consent screen, enter the App name, User support email, and Developer contact email address. Then click Save and Continue.
  9. Next, under the Scopes section, click the ADD OR REMOVE SCOPES button.
  10. In the Update selected scopes pane, search and select the gmail.readonly scope. Click Update, and then click Save and continue.


  11. Now, under the OAuth Client ID section, choose Web application in the Application type dropdown. Then name your app.


  12. Enter https://deluge.zoho.com/delugeauth/callback as the Authorized redirect URI.
  13. Click Create and download your credentials. This Client ID and others will be required later, while creating a connection in Zoho CRM.
  14. Navigate to the OAuth consent screen and click Add users under Test users. Enter the user's email address and click Save.
Creating a custom connector for Gmail
  1. Now the action shifts to Zoho CRM. Navigate to crm.zoho.com -> Settings -> Connections.
  2. Choose Custom Services and click Create Service.
  3. On the Create Service screen, choose OAuth 2.0 as the Authentication type and Header as the Parameter.
  4. Enter the Client ID, Client Secret, and Authorize URL generated from Google as shown in step 12 above.
    Tip: Having the Offline access type will allow your application to refresh tokens even when the user is not actively using the application.
  5. Then enter https://oauth2.googleapis.com/token as the Access token URL and Refresh token URL.
  6. Specify the necessary scopes like read and create, etc. and then click Create Service.
  7. On the next page, click Create Connection. Give the connection name and choose the scopes. Then click Create and Connect.
  8. Finally, authenticate the connection on the Google accounts page. Your custom connection will be created, and the two services can be integrated!
Now that the connection between Zoho CRM and Gmail has been established, you can use the invokeURL task to access and modify data in Gmail using the different APIs.

Sample
You can use the below code in invokeURL task to get the latest emails from Gmail.

userId = "emailaddress@gmail.com";
get_gmail = invokeurl
[
url: "https://gmail.googleapis.com/gmail/v1/users/"+userId+"/messages"
type: GET
connection : "connectionname"
];
messageID = get_gmail.get("messages").get(0).get("id");

get_gmail_withID = invokeurl
[
url: "https://gmail.googleapis.com/gmail/v1/users/"+userId+"/messages/"+messageID
type: GET
connection : "connectionname"
];

Content_of_the_mail = get_gmail_withID.get("snippet");
info "Mail Content : " + Content_of_the_mail;

gmail_values = get_gmail_withID.get("payload").get("headers");
for each headers in gmail_values
{
if ( headers.get("name") == "Subject" )
{
info "Subject of the Mail : " + headers.get("value");
}
if ( headers.get("name") == "From" )
{
info "From Address : " + headers.get("value");
}
}

References

----

And that's a wrap for today! We hope you found this post informative and start using custom connections to experience the full capabilities of Deluge and Zoho.

Kindly let us know if you have any questions, feedback, or suggestions in the comments, or write to us at support@zohodeluge.com!
 
Regards,
The Deluge Team

    Access your files securely from anywhere







                        Zoho Developer Community





                                              Use cases

                                              Make the most of Zoho Desk with the use cases.

                                               
                                                

                                              eBooks

                                              Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                               
                                                

                                              Videos

                                              Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                               
                                                

                                              Webinar

                                              Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                               
                                                
                                              • Desk Community Learning Series


                                              • Meetups


                                              • Ask the Experts


                                              • Kbase


                                              • Resources


                                              • Glossary


                                              • Desk Marketplace


                                              • MVP Corner




                                                        Manage your brands on social media



                                                              Zoho TeamInbox Resources



                                                                  Zoho CRM Plus Resources

                                                                    Zoho Books Resources


                                                                      Zoho Subscriptions Resources

                                                                        Zoho Projects Resources


                                                                          Zoho Sprints Resources


                                                                            Qntrl Resources


                                                                              Zoho Creator Resources



                                                                                  Zoho CRM Resources

                                                                                  • CRM Community Learning Series

                                                                                    CRM Community Learning Series


                                                                                  • Kaizen

                                                                                    Kaizen

                                                                                  • Functions

                                                                                    Functions

                                                                                  • Meetups

                                                                                    Meetups

                                                                                  • Kbase

                                                                                    Kbase

                                                                                  • Resources

                                                                                    Resources

                                                                                  • Digest

                                                                                    Digest

                                                                                  • CRM Marketplace

                                                                                    CRM Marketplace

                                                                                  • MVP Corner

                                                                                    MVP Corner







                                                                                      Design. Discuss. Deliver.

                                                                                      Create visually engaging stories with Zoho Show.

                                                                                      Get Started Now


                                                                                        Zoho Show Resources


                                                                                          Zoho Writer Writer

                                                                                          Get Started. Write Away!

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

                                                                                            Zoho CRM コンテンツ






                                                                                              Nederlandse Hulpbronnen


                                                                                                  ご検討中の方




                                                                                                        • Recent Topics

                                                                                                        • Show all items making up the composite item in transactions

                                                                                                          Dear Zoho, Currently, when we select a composite item in Zoho Inventory for a transaction, we do not receive a breakdown of the individual items that make up the composite. This makes it challenging for our team to accurately pick, pack, and ship the
                                                                                                        • Is it possible to do custom domains on test accounts that use saml setups?

                                                                                                          In Zoho Billing, Is it possible to do custom domains on test accounts that use saml setups for the customer portal?
                                                                                                        • "Recently Changed Payload Format" for webhooks in Zoho Billing

                                                                                                          We are seeing a message about recently changed payload format for webhooks in zoho billing. I cannot find any notification about this change can you give me more information on this?
                                                                                                        • Questions regarding WorkDrive

                                                                                                          Here are my questions regarding WorkDrive: Does WorkDrive have a limit on the number of downloads? What will happen if a file is downloaded excessively? Does WorkDrive have any restrictions on download speeds? Are there any limitations on downloading
                                                                                                        • Making money out of Zoho Sheets - How?

                                                                                                          Hello, Suppose I come up with a brilliant Zoho Sheet that I want to sell to other people, can I do this? How? Thanks.
                                                                                                        • 関連トピックから配信リストをつくる

                                                                                                          ZOHOキャンペーンの既存の連絡先リストを関連トピックで絞り込んで、配信リストを作成する方法があれば、教えてください。
                                                                                                        • zoho smtp limit for free users

                                                                                                          What is Zoho SMTP limit for free users?
                                                                                                        • Zoho Mail not working

                                                                                                          Anyone else had the issue where emails wont send from either the desktop CRM or the mail app? It just says "syncing" then "failed". I deleted it and tried to access emails through the CRM on my phone (fold) but they dont show. It seems it is impossible
                                                                                                        • Create static subforms in Zoho CRM: streamline data entry with pre-defined values

                                                                                                          Last modified on (9 July, 2025): This feature was available in early access and is currently being rolled out to customers in phases. Currently available for users in the the AU, CA, and SA DCs. It will be enabled for the remaining DCs in the next couple
                                                                                                        • Shorten one URL but not all

                                                                                                          I have read that I should be able to click on the shorten link button at the bottom of the post window and shorten just one URL. But it does all of the URLs in my post. I want only one shortened. Not sure what I'm missing. Any help appreciated.
                                                                                                        • [Free Webinar] Zoho RPA - OCR, PDF Automation, & More

                                                                                                          Hello Everyone! Greetings from the Zoho RPA Training Team! We’re excited to invite you to our upcoming webinar on the latest release updates for Zoho RPA, where we’ll unveil powerful new capabilities designed to make your automation journey smarter, faster,
                                                                                                        • What is Zoho Marketing Plus?

                                                                                                          As if there wasn't enough confusion with SalesIQ, CRM, Campaigns and Marketing Automation, now we have Marketing Plus too. Can somebody from Zoho please give us a comparative list of features that are in Marketing Plus compared to what's in Marketing
                                                                                                        • How can I create a button in a widget that pops up a form created in ZOHO Creator when clicked?

                                                                                                          I know that using HTML snippets, clicking the button can pop up the form. However, the same code does not work in the widget. <button><a href="#Form:form2?zc_LoadIn=dialog">Add</a></button>
                                                                                                        • Related Lists filter

                                                                                                          I have Contacts showing in our Accounts module. I customized the Contacts module with an Employment Status field, with the following picklist options: "Primary Contact", "Secondary Contact", "Active Staff(not a main contact)", and "No longer employed".
                                                                                                        • matches() returns different response in CRM vs public Deluge page

                                                                                                          I was using this public Deluge page to test using regular expressions with matches() to evaluate strings: https://deluge.zoho.com/tryout I was trying to use this regular expression to check a string for title case, making sure to escape the backslashes.
                                                                                                        • I didn't receive my domain verification mail

                                                                                                          I didn't receive my domain verification mail 
                                                                                                        • Rich Text For Notes in Zoho CRM

                                                                                                          Hello everyone, As you know, notes are essential for recording information and ensuring smooth communication across your records. With our latest update, you can now use Rich Text formatting to organize and structure your notes more efficiently. By using
                                                                                                        • Creating a new deal with specific layout and pipeline

                                                                                                          I am trying to create a button which creates a new deal for a particular account. It needs to be assigned a specific layout and pipeline. It seems like it should be really simple but I've been struggling to get this to work all day, can anyone help?!
                                                                                                        • Announcing New Features in Trident for macOS (v.1.21.0)

                                                                                                          Hello everyone! Trident for macOS is here with interesting features to elevate your workplace communication and productivity. Let's take a quick look at them. Get better visibility for concurrent events. Quickly compare and manage simultaneous events
                                                                                                        • Zoho Inventory search when adding items to SO/PO, etc.

                                                                                                          I do not see that Zoho Inventory searches within the item name for an item lookup. We have many products with variants. So when I search for a product, say a lighting system, and it comes in different sizes and colors, I can only get those products where
                                                                                                        • Introducing Zoho Commerce 2.0 — It's more than just selling!

                                                                                                          Hello! We are proud to launch Zoho Commerce 2.0, a reimagination of how online businesses look, feel, and function. This launch is both timely and symbolic, as we reaffirm our commitment to empowering small and medium enterprises with powerful, yet simple-to-use
                                                                                                        • Modifying Product Details

                                                                                                          I am in the process of setting up new products in Zoho Commerce and have encountered a few problems: 1) Tabs It seems that Product Details pages do not have the ability to create Tabs. eg:  https://www.thedebugstore.com/tp240141-aardvark-usb-i2c-spi-host-adapter-total-phase.html
                                                                                                        • Zoho Commerce B2B

                                                                                                          Hello, I have signed up for a Zoho Commerce B2B product demo but it's not clear to me how the B2B experience would look for my customers, in a couple of ways. 1) Some of my customers are on terms and some pay upfront with credit card. How do I hide/show
                                                                                                        • Creating a custom CSV file using deluge script/

                                                                                                          I have an application I have developed and the client wants us to place an export file in csv onto an ftp server daily. Now I don't see au options in creator to change the separator to anything else. The client wants the separator to be the pipe symbol "|"  I think i would be able to create schedule with some code to create the appropriate data in a string using deluge script but I haven't seen any functionality that would allow me to deposit that data as a file anywhere or attach it to an email
                                                                                                        • How to create knowledge base article from api?

                                                                                                          How to create knowledge base article from api?
                                                                                                        • Delay function execute

                                                                                                          I've got a workflow which uses a webhook to send information to Flow, which in return updates a record in Creator. Problem is, by the time this has executed, the rest of my script has run and can't find the (yet to be) updated info in the record. Is there
                                                                                                        • Zoho Books | Product updates | July 2025

                                                                                                          Hello users, We’ve rolled out new features and enhancements in Zoho Books. From plan-based trials to the option to mark PDF templates as inactive, explore the updates designed to enhance your bookkeeping experience. Introducing Plan Based Trials in Zoho
                                                                                                        • customize payment page

                                                                                                          Is there a way to customize, other than the theme colour, the payment page that customers are taken to from invoices? I can't seem to find a way. I just don't like the formatting of the current page and would like to make it look better. I've looked at
                                                                                                        • Anyone else experiencing very slow loading of pages in Zoho Projects?

                                                                                                          I reported this yesterday only to be told there are no issues but is anyone else experiencing stupidly slow loading of pages. On our loading screen, it is taking often as long as 60 seconds to load a page and just stays on this screen for ages! Other
                                                                                                        • How can I get a nested value attributes inside a key par?

                                                                                                          Hello! Im getting the following output when reviewing a record I am after. I am trying to put some conditions based on a data value that is inside another data. For example, lets grab the below output. Info {"Account_Name":{"name":"Liberty Construction
                                                                                                        • Unable to attach the file via the API.

                                                                                                          We are trying to attach files to a Candidate in Zoho Recruit using the API. We reviewed the following API documentation: 🔗 Upload Attachment While this API does allow file attachment via a URL, that’s not what we want — we do not want to attach public-facing
                                                                                                        • Item Batch Creation/Updation

                                                                                                          I have a requirement to integrate a local system with Zoho Books. I need to create items in Zoho Books with batch tracking enabled, but I couldn't find a specific API for that in the Zoho Books API documentation. Is there a dedicated API endpoint to create
                                                                                                        • Invoices not arriving and mail server settings

                                                                                                          I am having an issue where some clients are not receiving invoices. I have configured Zoho Books to send on my behalf and configured the appropriate SPF, DKIM and DMARC settings on my mail server and tested these as working. I get the CC'd copies so I
                                                                                                        • Issues With Image Formatting when Importing Word Documents as Articles

                                                                                                          Hello, I am having formatting issues when importing .docx files into articles. The documents look fine on Word, but once they are imported into an article, the images will overlap text and other images. Occasionally there will be added space between images
                                                                                                        • Multi Line Text Character Limit

                                                                                                          I want to export my Help Center articles but I realized that the text in the Answer column is being cut off. I'm guessing there is a character limit for multi line text fields. How can I get around this?
                                                                                                        • How do I associate pricebooks to a customer?

                                                                                                          I setup a few pricebooks, that worked fine. But now the only thing I can do with it, when I enter a quote or sales order, I can select which pricebook to use, but I have to do this product by product every time I add one. Is there a way to connect a pricebook
                                                                                                        • Emails bouncing to Hotmail / Outlook.com

                                                                                                          Today I have seen multiple emails bouncing all to Hotmail and outlook.com mailboxes, all other emails are being delivered. Is it just me or is this a widespread issue with Zoho Books ? Bounce Reason : uncategorized-bounce
                                                                                                        • Be careful if you want to purchase zoho one

                                                                                                          Hi, just to add one more complain to the other similar complains. When I purchased zoho one, Divith, my account manager told me (by email) that I would be able to keep different emails that I have inside the company (contact, privacy, etc.). During the
                                                                                                        • Schedule Timeout 5 minutes vs. stated 15 minutes

                                                                                                          I am running into a function run timeout error after 5 minutes for my schedules. The Functions - Limits documents states it should be 15 minutes: Functions - Limits | Online Help - Zoho CRM. What should it actually be? Due to the 5 minute timeout, I'm
                                                                                                        • I can't found API for Sales Receipts

                                                                                                          Hello May you please help me to find an API document for Sales Receipts to get data and retrive a custom fields like Invoice and credit notes Regards
                                                                                                        • Next Page