Gmail

Gmail is a free cloud mailing service provided by Google.  

Data integration: Skyvia supports importing data to and from Gmail, exporting Gmail data to CSV files, replicating Gmail data to relational databases, and synchronizing Gmail data with other cloud apps and relational databases.

Backup: Skyvia Backup does not support Gmail backup.

Query: Skyvia Query supports Gmail.

Establishing Connection

To create a connection, log in with Gmail account.

Creating Connection

To connect to Gmail, perform the following steps:

   connection

  1. Click Sign In with Google in the connection editor in Skyvia.
  2. Enter your Gmail credentials to log in.

    login

  3. Allow Skyvia to perform actions in Gmail.

    permission

Additional Connection Parameters

Suppress Extended Requests

When querying multiple records, Gmail API returns only part of the fields for some objects. Skyvia performs additional extended requests to query values of missing fields. Skyvia performs such API requests for each record of such object. However, this can decrease performance and significantly increase the number of API calls used.

The additional fields are the following:

Object Field
Drafts LabelIds, Snippet, SizeEstimate, HistoryId, UpdatedDate, Raw
Labels MessagesTotal, MessagesUnread, ThreadsTotal, ThreadsUnread
Messages LabelIds, Snippet, SizeEstimate, HistoryId, UpdatedDate, Raw
Threads Messages

You can select the Suppress Extended Requests checkbox to reduce the number of API calls.

Auto Send Messages

This option defines Gmail behavior after message creation.

If the option is set to True, a message is being created and automatically sent. If the option is set to False, a message is being created, but not sent.

If you need to create message in the particular folder, map the LabelIds to the needed value. For example, to create message in the “Sent” folder, map the LabelIds to the [“SENT”] value.

Connector specifics

Stored Procedures

Skyvia represents part of the supported Gmail features as stored procedures. You can call a stored procedure, for example, as a text of the command in the ExecuteCommand action in a Target component of a Data Flow or in Query.

UserStopReceivingPushNotifications

Use the following command to stop push notifications for the given user mailbox.

call UserStopReceivingPushNotifications(:UserId)

UserPushNotificationsWatch

Set up or update a push notification watch on the given user mailbox.

call UserPushNotificationsWatch(:UserId, :LabelIds, :LabelFilterAction, :TopicName)

Parameter Description
UserId The user’s email address
LabelIds List of labelIds to restrict notifications about. The valid values are: INBOX, SPAM, TRASH, UNREAD, STARRED, IMPORTANT, CATEGORY_PERSONAL, CATEGORY_SOCIAL, CATEGORY_PROMOTIONS, CATEGORY_UPDATES, CATEGORY_FORUMS
LabelFilterAction Filtering behavior of labelIds list specified. Valid values are Include, Exclude
TopicName Google Cloud Pub/Sub API topic name that the Gmail API should send notifications to.

 

MoveMessageToTrash

The following command moves the specified message to the trash.

call MoveMessageToTrash(:MessageId)

UntrashMessage

To remove the specified message from the trash, use the command

call UntrashMessage(:MessageId)

SendMessage

Use the following command to send a message and add it to the Messages object.

call SendMessage(:To, :From, :Subject, :Cc, :Bcc, :ReplyTo, :Text, :Html, :Attachments, :ThreadId)

SendRawMessage

The following command sends a message in the raw format (RFC-2822) and adds it to the Messages object.

call SendRawMessage(:Raw, :ThreadId)

VerifySendAsEmailAddress

Use the following command to send a verification email to the specified send-as alias address. The verification status must be pending.

call VerifySendAsEmailAddress(:SendAsEmail)

MoveThreadToTrash

The following command moves the specified thread to the trash. Any messages that belong to the thread are also moved to the trash.

call MoveThreadToTrash(:ThreadId)

RemoveThreadFromTrash

To remove the specified thread from the trash, use the following command.  

call RemoveThreadFromTrash(:ThreadId)

CreateRawMessage

To create a raw (RFC-2822) message in the current user’s mailbox without sending, use the following command.

call CreateRawMessage(:Raw, :ThreadId)

CreateMessage

To create a message in the current user’s mailbox without sending, use the following command.

call CreateMessage(:To, :From, :Subject, :Cc, :Bcc, :ReplyTo, :Text, :Html, :Attachments, :ThreadId)

Object peculiarities

To insert or update data in the Messages and Drafts tables,  map either the Raw field or one of the following fields:  Subject, From, To, Cc, Bcc, ReplyTo, Text, Html, Attachments.

Skyvia does not support import for the SettingsSendAs and  SettingsForwardingAddresses tables.

DML Operations

Skyvia supports the following DML operations for Gmail objects:

Action Object
INSERT, UPDATE, DELETE Drafts, Labels
INSERT, DELETE Messages, SettingsFilters
DELETE Threads

Incremental Replication and Synchronization

Replication with Incremental Updates is supported for the Messages and the Drafts tables.

The Messages table does not support the UPDATE operation, thus only the newly created records are considered in the replication.

Synchronization is supported for the Drafts table only.

Supported Actions

Skyvia supports all the common actions for Gmail.