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




                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day


                                      • Ask the Experts



                                          Zoho Marketing Automation


                                                  Manage your brands on social media



                                                        Zoho TeamInbox Resources

                                                          Zoho DataPrep 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

                                                                                                  • Zoho Workdrive file versions

                                                                                                    Hello. I have Workdrive setup to sync files offline to an external hard drive. The off line sync folder currently shows at 1.42 TB. I have a 5 TB storage limit in Workdrive. The cloud version of Workdrive says that I have used all 5 TB! I have 27, 285
                                                                                                  • Visual Sync Status Indicator

                                                                                                    I think I've see in documentation that WorkDrive had the industry standard of indicating a sync status for individual files and folders. I'm just starting with WD and synced my first test folder, but there was no way to tell what's happening by just looking
                                                                                                  • Integration with Zoho CRM?

                                                                                                    Will it be possible to integrate WorkDrive with CRM similar do Zoho Docs?
                                                                                                  • How to control the # of version of files to keep?

                                                                                                    Currently most of the WorkDrive Storage comprise of the many versions of files saved. How do I save some space and reduce the number of version of date or files saved in WorkDrive? Thanks
                                                                                                  • Should I Use Zoho Mail Calendar, or Zoho CRM Calendar, or Zoho Calendar?

                                                                                                    After a couple of dozens Zoho solopreneur products that I transitioned to after becoming a Zoho One enthusiast 5 years ago, I am finally preparing to conquer the remaining two bastions: Mail and WorkDrive (using Google Workspace at the moment). A NYC
                                                                                                  • Add comments to a form

                                                                                                    Hello, I'm trying to add comments to a form using a subform with one field named comment, but I don't want prior comments to be editable or deleteable by anyone (except the admin).  Is there a way to only display prior comments (with a datetime, user and comment field preferably) but still be able to add new ones when editing the main form?  I'm not tied to subforms if there is an easier was to do this?
                                                                                                  • Zoho Books | Product updates | March 2025

                                                                                                    Hello users, We have rolled out new updates in Zoho Books to enhance your accounting experience. These include the ability to create workflow rules for manual journals and Multi-Factor Authentication (MFA) for customer and vendor portals. Explore these
                                                                                                  • Trying to export a report to Excel via a deluge script

                                                                                                    I have this code from other posts but it gives me an error of improper statement, due to missing ; at end of line or incomplete expression. Tried lots of variations to no avail. openUrl(https://creatorapp.zoho.com/<username>/<app name>/XLSX/#Report:<reportname>,"same
                                                                                                  • Work Drive Tray Icon Missing

                                                                                                    How can I get the tray icon back? The app froze, had to restart PC and then it's been gone since...  I've re-installed the windows program and restarted my machine twice now.
                                                                                                  • cant receive emails

                                                                                                    I have checked the Dns and everything seems to be fine pls check the print screens attached below help me cause i need to solve this fast
                                                                                                  • Retainer invoice in Zoho Finance modlue

                                                                                                    Hello, Is there a way of creating retainer invoices in the Zoho Finance module? If not can I request this is considered for future updates please.
                                                                                                  • iOS Widget Not Working

                                                                                                    It appears that the iOS widget is not working, displaying a blank white screen instead of a selected note. I’m using app version 6.5.12 and iOS 18.3.1.
                                                                                                  • Two Problems With Data Imported to Notes

                                                                                                    Occasionally I want to create a note by copying and pasting a few paragraphs from an article on line. When I create a new note and paste in the section the newly created note winds up with each paragraph in white text on a dark background rather than
                                                                                                  • Workdrive on Android - Gallery Photo Backups

                                                                                                    Hello, Is there any way of backing up the photos on my android phone directly to a specific folder on Workdrive? Assuming i have the workdrive app installed on the phone in question. Emma
                                                                                                  • Generate a link for Zoho Sign we can copy and use in a separate email

                                                                                                    Please consider adding functionality that would all a user to copy a reminder link so that we can include it in a personalized email instead of sending a Zoho reminder. Or, allow us to customize the reminder email. Use Case: We have clients we need to
                                                                                                  • How to associate a document sent in Zoho Sign with an deal in the CRM?

                                                                                                    Hi, often documents are loaded in Zoho sign and sent for signature. These sometimes are linked to a deal in the Zoho CRM and would be nice to see the status of the document within the CRM. I am aware of the integration, but that assumes that the document
                                                                                                  • Preventing auto-redirect to Parent Record on Save...

                                                                                                    Our users often create records from the related list on th left side of the screen. They click the blue "plus" button to create the record. This is handy, but for some modules, or situations, they would like to remain on the record AFTER clicking "Save",
                                                                                                  • CRM Portal Help

                                                                                                    Hello, I am trying to set up a portal to connect with our referring doctors to keep patient cases organized. I set up the accounts module as office, the contacts as doctors, the leads as patients, and the deals as treatments. Everything seems to work
                                                                                                  • Zoho Books (UK) needs to be able to submit a CT600 CTSA return

                                                                                                    As well as a VAT Return, most (if not all) small businesses have to submit a CT600 Corporation Tax Self-Assessment. There are many providers who do this (like Xero) bujt not Zoho. Can you add this to the request list please? Many thanks Steve
                                                                                                  • No image image comes out in the recipient when I sent an email

                                                                                                    Hello to the entire forum, when I send an email from Zoho, my profile picture does not come out. On the other hand, if you do, using Gmail accounts. How is it configured to leave ??? Thank you Greetings !!
                                                                                                  • Zoho Desk & Tasks

                                                                                                    Hi, I'd like to be able to create a set of tasks each time a customer request comes in, as I understand it, currently each would need to be create manually. Project is too much of an overhead for what we want to use. Effectively in various use cases we
                                                                                                  • zet pack not working

                                                                                                    We are using the zet pack command to package our Zoho extension. However, after running the command, the extension gets packed, but the resulting package is empty. We've attached a screenshot for reference. Could you please assist us with resolving this
                                                                                                  • While retrieving the Balance Sheet Report, there is always this "COST OF GOODS SOLD", This is not editable.

                                                                                                    Hi Zoho & Readers, While retrieving the Balance Sheet Report, there is always this "COST OF GOODS SOLD", which is reduced from the Sales to arrive at the gross profit. The issue I face here is that Service Oriented Companies don't incur any COGS, hence
                                                                                                  • Changing salesorder_number via zoho flow

                                                                                                    For some reason updating salesorder_number via zoho flow does not stick. Flow is triggered by new sales order filtered by sales channel update sales order: PO#: CX${trigger.reference_number} Salesorder_number: CX${trigger.reference_number} PO# successfully
                                                                                                  • Working with Products that are non-tangible

                                                                                                    How does one create a 'service' in products? Is there a way to disable inventory functions for things like Sofware as a service? The services module doesn't look to be much help either. Not sure how to do this in CRM
                                                                                                  • Loop in Blueprint but it works. Why? How should this be set?

                                                                                                    see picture
                                                                                                  • Zoho Error: This Operation has been restricted. Please contact support-as@zohocorp.com for further details

                                                                                                    Hello There, l tried to verify my domain (florindagoreti.com.br) and its shows this error: This Operation has been restricted. Please contact support-as@zohocorp.com for further details. Screenshot Given Below -  please check what went wrong. Thanks
                                                                                                  • Bulk Delete Images

                                                                                                    How do I bulk Delete Images from Zoho Campaigns. We have been using the Zoho since 2019 and can still only see the option to delete images one by one and we have a lot of old Campaign imagery we don't need anymore. Thanks!
                                                                                                  • Tip #5: Setting access rights at the subfolder level

                                                                                                    Hello everyone, We hope you're finding our WorkDrive Tips and Tricks series useful. For today's tip, we'll teach you how to assign higher subfolder permissions to Team Folder members. Team Folders helps you avoid the drawbacks of traditional file sharing.
                                                                                                  • I want to update the photo from the mobile app to the product tab product.

                                                                                                    I want to update the photo from the mobile app to the product tab product. Because I want to use the CRM product tab for inventory management Contact registration can save photos from the mobile app. Attached screenshot.
                                                                                                  • Setting default From address when replying to request

                                                                                                    At the moment, if I want to reply to a request, the From field has three options, company@zohosupport.com, support@company.zohosupport.com, and support@company.com.  The first two are really internal address that should never be seen by the customer and
                                                                                                  • Enable Image and Hyperlink Sync in Zoho Desk - Jira Integration

                                                                                                    Hi, We are using the Zoho Desk - Jira integration, which allows comments to sync automatically between a Zoho Desk ticket and its linked Jira issue. However, we have noticed a limitation: When adding a hyperlink or image in a Zoho Desk comment, it is
                                                                                                  • Deluge Function to Update Custom Field

                                                                                                    I'm trying to get a Deluge function (which will run as part of a Schedule in Desk) that retrieves all tickets with the status "Recurring" and updates the custom field checkbox "cf_recurring" to "true". Here's what I have, which doesn't work: searchValue
                                                                                                  • Implement Date-Time-Based Triggers in Zoho Desk

                                                                                                    Dear Zoho Desk Support Team, We are writing to request a new feature that would allow for the creation of workflows triggered by specific date-time conditions. Currently, Zoho Desk does not provide native support for date-time-based triggers, limiting
                                                                                                  • How many ZOHO-Sites does the ZOHO-One Suite allow for?

                                                                                                    The free version of ZOHO-Sites allows for two sites, but it seems that the professional version (which is included in the ZOHO-One Suite) only allows for two websites. Is that correct? How many sites can I have within one ZOHO-One account?
                                                                                                  • Zoho desk Spam Folder

                                                                                                    Dear Zoho Support Team, We are experiencing an issue with Zoho Desk, where all emails sent to our customers are being marked as spam. As a result, they are not receiving notifications for new ticket replies. Please assist us in resolving this issue.
                                                                                                  • Is Zoho Tables part of Zoho One

                                                                                                    Cant seem to add the app as part of my Zoho One Subscription?
                                                                                                  • Canva Integration

                                                                                                    Hello! As many marketing departments are streamlining their teams, many have begun utilizing Canva for all design mockups and approvals prior to its integration into Marketing automation software. While Zoho Social has this integration already accomplished,
                                                                                                  • Possible to filter out contacts that hasn't opened emails in Cadence?

                                                                                                    We use Cadences in various outreach - is it possible in analytics or reports to filter out the contacts that have not opened their emails?
                                                                                                  • On Duty Requests using API

                                                                                                    Currently we can only do attendance entries using API, we need to make on Duty Requests using API Use Case We are using different on premise devices to track meetings, we want to sync this data with Zoho People Currently we are manually making on duty
                                                                                                  • Next Page