Skip to main content
All CollectionsAppsApps in Albato
How to connect Gmail using oAuth app
How to connect Gmail using oAuth app

You can now access emails via Gmail API, offering RESTful features for stable email retrieval preferred by Google over IMAP

Manuel Bernal avatar
Written by Manuel Bernal
Updated over a week ago

Now you can receive emails via the Gmail API. The API provides you with RESTful access to the features you usually have with Gmail. Google prefers API, so receiving emails via API is more stable than via IMAP.

How automation works

The trigger sends requests to the mailbox every five minutes and receives all the emails that have been received in the last hour. Each message is transferred without parsing the message body, saving all tags.


To receive emails via API, you need to create an OAuth application in your Google account, then copy the _Client ID_ and the _Client Secret_ values, paste them into Albato connection settings and grant access.


As we create a special oAuth application, we use a special Albato partner "Gmail — to receive emails".

How to create an app

Open the Google Cloud Platform, then create or select the project.


and click _ENABLE APIS AND SERVICES_ button:


Find and select the Gmail API in the search bar.


Click _Enable _button.


Now go to the APIs & Services section → OAuth consent screen select _External user_ type and click _Create_ button.


Open the _App information_ section and enter any name in the _App name_ field, e.g. Albato.


In the _User support email_ field, select your Google email address from the list. This is your private, non-public application, so no one can see it.


Skip the _App domain_ field.


In_ Authorized domains_ section create two domains:

  • albato.ru

  • albato.com


In the _Developer contact information_ field, enter your email address.
Click _Save_ and _continue_ button.


On the next page, click on the Add or Remove Scopes button:


In the search bar, enter Gmail API and check the boxes for the specified scopes:


After the access settings, click _Save_ and _continue_ button below.


Then click _Add users_ button.


Add your Google email address. If necessary, you can add up to 100 email addresses that will be granted access to the application. Only the users listed here will be able to create a connection in Albato:


Then check the settings. If it is correct, then proceed to the next step and create oAuth credentials for the connection. Open the Credentials tab.


Click _Create credentials_ button and select _OAuth client ID_ from the list:


From the _Application type list_, select _Web application_ value. In the _Name_ field, enter the name of the application, e.g Albato.


In the _Authorized redirect URIs_ section, click _ADD URI_ button:


Click _Create_ button. After that, the application will be created and the following window will appear:


Copy _Client ID_ and _Client Secret_ values to create a connection in Albato.


You can always go to the _Credentials_ tab, click the pencil next to the created oAuth connection and copy the required IDs.

How to create an Albato connection

Go to the _Apps_ section, click the _Add a connection_ button and select _Gmail — receiving emails_ value from the list.


Enter any name for your connection, and paste the _Client ID_ and the _Client Secret_ values that you copied from the ___Credentials___ section.


Click the _Next_ button and grant Albato access. If connection settings are correct, the Gmail login window will appear. Select your email.


Then click the _Continue_ button. This warning will appear:


It appears because it is a non-public application and has not been moderated. Then click the _Continue_ button:


The connection setup is completed. Now you can create automations with this trigger, and receive new emails in origin format.

Did this answer your question?