This section provides samples for the Drive API.
Check out the Drive API video library for links to introductory videos on using the API.
The samples listed below and indexed in the left navigation menu are hosted on GitHub. You can fork these repositories and use the code as a reference for your own projects.
Meta Displayer
Meta Displayer is a JavaScript app that uses the file picker to open and display metadata for a file. The example contains working code showing:
- Authorizing an application and authenticating user requests
using the
drive.file
scope - Using the Drive file picker.
- Using
files.get
to get additional fields for a file.
To view or download the source, visit the Metadisplayer on the GitHub repo.
QuickEditor
Each of the Google Drive platform-specific examples reflects a single
sample app: a text editor capable of
editing Google Drive files with the MIME type text/*
.
The web version
implements two fundamental Google Drive use cases:
The flow for both use cases is similar. Google Drive redirects a user to the app after the user selects it from the Create menu or context menu of a file with a registered MIME type.
To view or download the source, visit the QuickEditor on the GitHub repo.