Skip to main content

Google Drive Component

Manage files in Google Drive

Component key: google-drive

Description#

Google Drive is Google's cloud storage for work and home. This component allows you to create, copy, download, update, list, and delete files stored in a Google Drive Account.

Documentation for the Node.js client used in this component can be found at https://developers.google.com/drive/api/v3/quickstart/nodejs.

A common integration pattern involves listing files in a file store, and performing a series of actions on the array of files that are returned. See our looping over files quickstart for information about how to create a loop over an array of files.

Authorization Notes#

The Google Drive component requires authentication through Google's OAuth service. To create a Google Drive developer account and authenticate using google OAuth, follow directions on https://drive.google.com/docs/authentication/getting-started.

Actions#

Copy File#

Copy a file by file id | key: copyFile

InputKeyNotesExample

File ID

string
/ Required
fileIdA unique opaque ID for each file. File IDs are stable throughout the life of the file, even if the file name changes.my-example-file-id

File Name

string
fileNameProvide a string for the name of the new file.myFile

Folder ID

string
folderIdA unique opaque ID for each folder.my-example-folder-id

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

{  "data": {    "config": {},    "data": {      "type": "Buffer",      "data": [        101,        120,        97,        109,        112,        108,        101      ]    },    "status": 404,    "statusText": "error",    "request": {      "responseURL": "www.example.com"    }  }}

Create File#

Create a new file with content and metadata | key: createFile

InputKeyNotesExample

File Content

string
/ Required
fileContentThe binary or text body of the file. Some content examples you can store in Google Drive are images, videos, text, and PDF.My Example File Contents

File Name

string
fileNameProvide a string for the name of the new file.myFile

Folder ID

string
folderIdA unique opaque ID for each folder.my-example-folder-id

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

{  "data": {    "config": {},    "data": {      "type": "Buffer",      "data": [        101,        120,        97,        109,        112,        108,        101      ]    },    "status": 404,    "statusText": "error",    "request": {      "responseURL": "www.example.com"    }  }}

Create Folder#

Create a directory file | key: createFolder

InputKeyNotesExample

Folder Name

string
/ Required
folderNameProvide a string for the name of the new folder.Pictures

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

{  "data": {    "config": {},    "data": {      "type": "Buffer",      "data": [        101,        120,        97,        109,        112,        108,        101      ]    },    "status": 404,    "statusText": "error",    "request": {      "responseURL": "www.example.com"    }  }}

Delete File#

Delete a file by file id | key: deleteFile

InputKeyNotesExample

File ID

string
/ Required
fileIdA unique opaque ID for each file. File IDs are stable throughout the life of the file, even if the file name changes.my-example-file-id

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

{  "data": {    "config": {},    "data": {      "type": "Buffer",      "data": [        101,        120,        97,        109,        112,        108,        101      ]    },    "status": 404,    "statusText": "error",    "request": {      "responseURL": "www.example.com"    }  }}

Empty Trash#

Empty the trash of deleted files | key: emptyTrash

InputKeyNotesExample

File ID

string
/ Required
fileIdA unique opaque ID for each file. File IDs are stable throughout the life of the file, even if the file name changes.my-example-file-id

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

{  "data": {    "config": {},    "data": {      "type": "Buffer",      "data": [        101,        120,        97,        109,        112,        108,        101      ]    },    "status": 404,    "statusText": "error",    "request": {      "responseURL": "www.example.com"    }  }}

Get About#

Gets information about the user's Drive, and system capabilities | key: getAbout

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

{  "data": {    "config": {},    "data": {      "type": "Buffer",      "data": [        101,        120,        97,        109,        112,        108,        101      ]    },    "status": 404,    "statusText": "error",    "request": {      "responseURL": "www.example.com"    }  }}

Get File#

Gets a file's metadata and content by ID. | key: getFile

InputKeyNotesExample

File ID

string
/ Required
fileIdA unique opaque ID for each file. File IDs are stable throughout the life of the file, even if the file name changes.my-example-file-id

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

{  "data": {    "type": "Buffer",    "data": [      69,      120,      97,      109,      112,      108,      101    ]  }}

List Files#

lists all available files and directories | key: listFiles

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

{  "data": {    "config": {},    "data": {      "type": "Buffer",      "data": [        101,        120,        97,        109,        112,        108,        101      ]    },    "status": 404,    "statusText": "error",    "request": {      "responseURL": "www.example.com"    }  }}

Update File#

Updates a file's content by file id | key: updateFile

InputKeyNotesExample

File Content

string
/ Required
fileContentThe binary or text body of the file. Some content examples you can store in Google Drive are images, videos, text, and PDF.My Example File Contents

File ID

string
/ Required
fileIdA unique opaque ID for each file. File IDs are stable throughout the life of the file, even if the file name changes.my-example-file-id

File Name

string
fileNameProvide a string for the name of the new file.myFile

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
OAuth 2.0 - Authorization Codeoauth2OAuth 2.0 authorization using the authorization code grant type

Client ID |  client_id

Client Secret |  client_secret

Scopes |  scopes

Authorization URL |  auth_uri

Access Token URL |  token_uri

Output Example Payload#

{  "data": {    "config": {},    "data": {      "type": "Buffer",      "data": [        101,        120,        97,        109,        112,        108,        101      ]    },    "status": 404,    "statusText": "error",    "request": {      "responseURL": "www.example.com"    }  }}