Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.18 KB

File metadata and controls

55 lines (35 loc) · 1.18 KB

Drive v3 API Samples

These samples allow you to list, download, and upload files from Google Drive.

Running the samples

Note: Node.js version 8 or greater is required to run samples.

Set the following values in oauth2.keys.json (up one directory):

  • client_id
  • project_id
  • client_secret

Run the quickstart.js sample:

This sample will list the files in the user's Google Drive.

You'll need to do the following before you can run this sample:

  • Enable the Google Drive API.
  • Set the redirect API in the Google Cloud Console application registration to http://localhost:3000/oauth2callback.
node quickstart.js

Run the download.js sample:

Run the quickstart.js sample to get a list of files in your Google Drive.

node download.js <fileId>

where <fileId> is the id of any file in Google Drive.

Example:

node download.js 0B_Klegupc5gUcXhFZjZVUV9NeE0

Run the export.js sample:

node export.js <fileId>=

where <fileId> is the id of a Google Doc in Google Drive.

Example:

node export.js 0B_Klegupc5gUcXhFZjZVUV9NeE0 ./file.pdf