Google Drive Service Acc Plugin

Demo to preview the settings

Introduction

Push files to Google Drive using a Service Account. The easiest way to allow your app to move data on its own.
NOTE: This is the JSON WEB Token authentication version, users will access the Service Account Google Drive. For the information on how to obtain Service Account Keys for a Service Acc. Plugin, please read here: https://docs.zeroqode.com/obtaining-google-service-account-keys
All pushed files are stored in Google Service account and can be retrieved only through the API (for instance- Get Files). The files are NOT stored in Google Drive itself.
💡
TIP: Service accounts, types of service accounts, and the IAM roles that are available to service accounts please find here: https://cloud.google.com/iam/docs/service-accounts
A shared drive is an organizational structure within Google Drive that lives parallel to My Drive. You can organize an individual file within a shared drive or in My Drive but not both. For more details please visit this page: https://developers.google.com/drive/api/v3/about-files

Prerequisites

For using the plugin you'll need to get the API credentials with JWT for Google Create your development account at: https://console.cloud.google.com/home/dashboard and also enable Google Drive API in the console.
Image without caption

How to setup

Go to your Google Console and add a new project.
Image without caption
Image without caption
Enter your project name and click "Create"
If necessary, add an organization
Image without caption
Select your project
Image without caption
Image without caption
Go to APIs and services > Library
Image without caption
Find Google Drive API and click it
Image without caption
Press Enable
Image without caption
Go to APIs and services > Credentials
Image without caption
Click Create Credentials
Image without caption
In appeared dropdown select Service account
Image without caption
Enter service account name
Image without caption
You can skip the next two steps
Image without caption
Click Service Account email
Image without caption
Select KEYS tab
Image without caption
Add key
Image without caption
Image without caption
Image without caption
IMPORTANT: Save the .json file
Open APIs and services > OAuth consent screen
Image without caption
Select as user type External and press Create and complete form
Image without caption
Find your .json file and open it
You can open file with any text editor (Notepad, Notepad++, Sublime Text, Atom, etc.)
Image without caption
Image without caption
javascript
{ "type": "service_account", "project_id": "project-id", "private_key_id": "key-id", "private_key": "-----BEGIN PRIVATE KEY-----\nprivate-key\n-----END PRIVATE KEY-----\n", "client_email": "service-account-email", "client_id": "client-id", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service-account-email" }
Use string from "client_email" as Iss (account email)
Image without caption
Image without caption
Use string from "private_key" field as Private key
IMPORTANT: Need to replace all "\n" symbols in key with linebreak ("Enter" button)!
Image without caption

Plugin Data Calls

Get Files API v2

Get Files (API v3) Extended

Get File Info

Get Image from Drive

Download File

Gets a permission by ID

Get permissions

Plugin Action Calls

Delete File

Create a File

Upload a File (base64)

Add File to Folder

Remove File From Folder

Remove Everyone With Link Permission (Read)

Remove Everyone With Link Permission (Write)

Give a User Permission (Write)

Give a User Permission (Read)

Give Everyone Permission (Write)

Give Everyone Permission (Read)

Remove Permission Using ID

Update a User’s Permission (Read)

Update a User’s Permission (Write)

Rename File

Export File

Plugin Actions

Generate Sort Query v2

Generate Sort Query v3

Things to Note

For file name untitled issue , you'll need to create a workflow of a few steps, both of which are calls found in plugin:
  • Upload File -> (Get File Id result from step 1) -> Rename File.
Image without caption

Changelogs