PLATFORMS SOLUTIONS BLOGS CONTACT

GoogleDrive Adapter



This adapter allows you to manage GoogleDrive folders and files.


This adapter requires you to register an application with Google Services and configure OAuth access.


OAuth Configuration

This adapter requires OAuth to be configured.

show steps  Download the GoogleSheet configuration instructions

  • Obtain an API Key and API Secret from Google and save in a Config Setting in Enzo
    In this initial step, you must have an account with Google, and create a Project in the Google Developer Console so that you can obtain an OAuth Client ID.
    Make sure to select the GoogleDrive API Library
    Once you have this information, locate your ClientID and Client Secret, and create a new Config Setting in Enzo Manager with this information, and save the config. Mark it as the default setting to make things easier.
  • Execute GetAuthUrl to obtain the correct URL and paste it in a browser to authenticate
    Start SQL Server Management Studio (SSMS), connect to Enzo directly, and execute the GetAuthUrl method.
    EXEC GoogleDrive.getAuthURL null, 'https://www.googleapis.com/auth/drive' The GetAuthUrl method returns a URL that you can copy and paste in a browser; this URL is constructed dynamically.
    You may receive an error saying the App isn't verified; click on the Go To Application link
    Once the authentication flow is completed, you will get a blank webpage; the URL bar on the browser will contain a return code. Copy the complete URL provided before going to the next step.
  • Copy the ResponseCode provided and execute the GetTokens command passing the Response Code
    The GetTokens method requires the complete URL provided in the previous step. This will extract the response code and return an Access Token. Note that the URL is only valid for a period of time. Copy the AccessToken in memory.
  • Copy the AccessToken and RefreshToken provided by the previous call and save them into the same Config Setting
    These tokens must be saved in the Config Setting previously created.


Configuration Settings



Name Description Default
Boolean _isDefault Make this the default configuration. Defaults to true if configName is already the default.
String accessToken The access token when not redirected to browser for authentication
String refreshToken The refresh token used when accessToken is expired
String clientID The client ID to be used for token generation and authentication.
String clientSecret The Client Secret key to be used for token generation and authentication.

Handlers



CreateFile
Files
Create new file at google drive root details 

Arguments

Name Description Default
filename R

SQL Call

EXEC GoogleDrive.CreateFile


Http Call

/bsc/googledrive/createfile

Output Columns

String outputType
CreateFileEx
FilesEx
Create new file at google drive root details 

Arguments

Name Description Default
configName
filename R

SQL Call

EXEC GoogleDrive.CreateFileEx


Http Call

/bsc/googledrive/createfileex

Output Columns

String outputType
CreateFolder
Folders
Create new folder at google drive root details 

Arguments

Name Description Default
folderName R
parentFolder

SQL Call

EXEC GoogleDrive.CreateFolder
INSERT INTO GoogleDrive.Folders@config1 (folderName) VALUES ('test')


Http Call

/bsc/googledrive/createfolder

Output Columns

String fileIdThe fileId of the folder created
CreateFolderEx
FoldersEx
Create new folder at google drive root details 

Arguments

Name Description Default
configName
folderName R
parentFolder

SQL Call

EXEC GoogleDrive.CreateFolderEx
INSERT INTO GoogleDrive.FoldersEx@config1 (folderName) VALUES ('test')


Http Call

/bsc/googledrive/createfolderex

Output Columns

String fileIdThe fileId of the folder created
DeleteFile
Files
Delete particular file by passing file id details 

Arguments

Name Description Default
fileId R

SQL Call

EXEC GoogleDrive.DeleteFile
delete FROM GoogleDrive.files@configName where fileId='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'
delete FROM GoogleDrive.[files@configName] where fileId='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'


Http Call

/bsc/googledrive/deletefile

Output Columns

This call does not return data.

DeleteFileEx
FilesEx
Delete particular file by passing file id details 

Arguments

Name Description Default
configName
fileId R

SQL Call

EXEC GoogleDrive.DeleteFileEx
delete FROM GoogleDrive.FilesEx@configName where fileId='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'
delete FROM GoogleDrive.[FilesEx@configName] where fileId='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'


Http Call

/bsc/googledrive/deletefileex

Output Columns

This call does not return data.

DeleteFolder
Folders
Delete particular file or folder by passing file id details 

Arguments

Name Description Default
fileId R

SQL Call

EXEC GoogleDrive.DeleteFolder
DELETE FROM GoogleDrive.Folders@configName where fileId='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'
DELETE FROM GoogleDrive.[Folders@configName] where fileId='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'


Http Call

/bsc/googledrive/deletefolder

Output Columns

This call does not return data.

DeleteFolderEx
FoldersEx
Delete particular file or folder by passing file id details 

Arguments

Name Description Default
configName
fileId R

SQL Call

EXEC GoogleDrive.DeleteFolderEx
DELETE FROM GoogleDrive.FoldersEx@configName where fileId='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'
DELETE FROM GoogleDrive.[FoldersEx@configName] where fileId='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'


Http Call

/bsc/googledrive/deletefolderex

Output Columns

This call does not return data.

DownloadFile
upload file at google drive on given path details 

Arguments

Name Description Default
filename R
downloadPath
override False
timeout 0
retryCount 3

SQL Call

EXEC GoogleDrive.DownloadFile


Http Call

/bsc/googledrive/downloadfile

Output Columns

String fileName
String tmpFileName
Int64 byteTx
Double elapsedTime
DownloadFileEx
upload file at google drive on given path details 

Arguments

Name Description Default
configName
filename R
downloadPath
override False
timeout 0
retryCount 3

SQL Call

EXEC GoogleDrive.DownloadFileEx


Http Call

/bsc/googledrive/downloadfileex

Output Columns

String fileName
String tmpFileName
Int64 byteTx
Double elapsedTime
getAuthURL
authURL
Get Authentication url details 

Arguments

Name Description Default
scope https://www.googleapis.com/auth/drive
baseURL https://accounts.google.com/o/oauth2/auth

SQL Call

EXEC GoogleDrive.getAuthURL
SELECT * FROM GoogleDrive.authURL WHERE scope='https://www.googleapis.com/auth/drive.file'


Http Call

/bsc/googledrive/getauthurl

Output Columns

String url
getAuthURLEx
authURLEx
Get Authentication url details 

Arguments

Name Description Default
configName
scope https://www.googleapis.com/auth/drive
baseURL https://accounts.google.com/o/oauth2/auth

SQL Call

EXEC GoogleDrive.getAuthURLEx
SELECT * FROM GoogleDrive.authURLEx WHERE scope='https://www.googleapis.com/auth/drive.file'


Http Call

/bsc/googledrive/getauthurlex

Output Columns

String url
getTokens
tokens
Get authentication token details 

Arguments

Name Description Default
codeResponse R

SQL Call

EXEC GoogleDrive.getTokens
SELECT * FROM GoogleDrive.tokens


Http Call

/bsc/googledrive/gettokens

Output Columns

String code
String accessToken
Int32 expiresIn
String refreshToken
String scope
String token_type
getTokensEx
tokensEx
Get authentication token details 

Arguments

Name Description Default
configName
codeResponse R

SQL Call

EXEC GoogleDrive.getTokensEx
SELECT * FROM GoogleDrive.tokensEx


Http Call

/bsc/googledrive/gettokensex

Output Columns

String code
String accessToken
Int32 expiresIn
String refreshToken
String scope
String token_type
ListFiles
Files
Read all the files from google drive root details 

Arguments

Name Description Default
folder
fileName
createdDate
lastModifiedDate

SQL Call

EXEC GoogleDrive.ListFiles
SELECT * FROM GoogleDrive.Files@configName
SELECT * FROM GoogleDrive.[Files@configName]


Http Call

/bsc/googledrive/listfiles

Output Columns

String fileName
String fileId
DateTime createdDate
DateTime lastModifiedDate
Int64 fileSize
String filePath
String mimeType
Boolean isFolder
ListFilesEx
FilesEx
Read all the files from google drive root details 

Arguments

Name Description Default
configName
folder
fileName
createdDate
lastModifiedDate

SQL Call

EXEC GoogleDrive.ListFilesEx
SELECT * FROM GoogleDrive.FilesEx@configName
SELECT * FROM GoogleDrive.[FilesEx@configName]


Http Call

/bsc/googledrive/listfilesex

Output Columns

String fileName
String fileId
DateTime createdDate
DateTime lastModifiedDate
Int64 fileSize
String filePath
String mimeType
Boolean isFolder
refreshTokens
accesstokens
Get access token details 

Arguments


SQL Call

EXEC GoogleDrive.refreshTokens
SELECT * FROM GoogleDrive.accesstokens


Http Call

/bsc/googledrive/refreshtokens

Output Columns

String access_token
Int32 expires_in
String scope
String token_type
refreshTokensEx
accesstokensEx
Get access token details 

Arguments

Name Description Default
configName

SQL Call

EXEC GoogleDrive.refreshTokensEx
SELECT * FROM GoogleDrive.accesstokensEx


Http Call

/bsc/googledrive/refreshtokensex

Output Columns

String access_token
Int32 expires_in
String scope
String token_type
RenameFile
Files
Rename specific file by passing fileid details 

Arguments

Name Description Default
fileId R
filename R

SQL Call

EXEC GoogleDrive.renamefile 'config2',@fileid='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe',@filename='test'
update GoogleDrive.files@config2 set filename = 'test' where fileid='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'


Http Call

/bsc/googledrive/renamefile

Output Columns

String outputType
RenameFileEx
FilesEx
Rename specific file by passing fileid details 

Arguments

Name Description Default
configName
fileId R
filename R

SQL Call

EXEC GoogleDrive.renamefileEx 'config2',@fileid='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe',@filename='test'
update GoogleDrive.filesEx@config2 set filename = 'test' where fileid='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'


Http Call

/bsc/googledrive/renamefileex

Output Columns

String outputType
RenameFolder
Folders
Rename specific folder by passing fileid details 

Arguments

Name Description Default
fileId R
filename R

SQL Call

EXEC GoogleDrive.renamefolder 'config2',@fileid='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe',@filename='test'
update GoogleDrive.folders@config2 set filename = 'test' where fileid='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'


Http Call

/bsc/googledrive/renamefolder

Output Columns

This call does not return data.

RenameFolderEx
FoldersEx
Rename specific folder by passing fileid details 

Arguments

Name Description Default
configName
fileId R
filename R

SQL Call

EXEC GoogleDrive.renamefolderEx 'config2',@fileid='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe',@filename='test'
update GoogleDrive.foldersEx@config2 set filename = 'test' where fileid='1wjDjuiHWB8-mZZNDITWVjbWdgs5UI7Fe'


Http Call

/bsc/googledrive/renamefolderex

Output Columns

This call does not return data.

UploadFile
File
upload file at google drive on given path details 

Arguments

Name Description Default
sourceFile R
filename R
override False
timeout 0

SQL Call

EXEC GoogleDrive.UploadFile
INSERT INTO GoogleDrive.File@config1 (sourceFile,filename) VALUES ('abc.txt','d2.txt')


Http Call

/bsc/googledrive/uploadfile

Output Columns

String fileName
String fileId
Int64 byteTx
Double elapsedTime
UploadFileEx
FileEx
upload file at google drive on given path details 

Arguments

Name Description Default
configName
sourceFile R
filename R
override False
timeout 0

SQL Call

EXEC GoogleDrive.UploadFileEx
INSERT INTO GoogleDrive.FileEx@config1 (sourceFile,filename) VALUES ('abc.txt','d2.txt')


Http Call

/bsc/googledrive/uploadfileex

Output Columns

String fileName
String fileId
Int64 byteTx
Double elapsedTime







601 21st St Suite 300
Vero Beach, FL 32960
United States

(561) 921-8669
info@enzounified.com
terms of service
privacy policy

PLATFORM

ENZO SERVER
ENZO DATAZEN

SOLUTIONS

SOLUTIONS OVERVIEW
INTEGRATION
SaaS
CLOUD ANALYTICS

RESOURCES

DOWNLOAD
BLOGS & VIDEOS
IN THE NEWS
ENZO ADAPTERS
ONLINE DOCUMENTATION
TCO CALCULATOR

COMPANY

LEADERSHIP TEAM
PARTNERS


© 2023 - Enzo Unified