Notice: important security update for Drive document URLs and resource keys. For more information, refer to Access link-shared files using resource keys

Drive Platform Samples

This section provides samples and learning resources for the Drive platform.

Check out the Drive API video library for links to introductory videos on using the API. The Drive API intro codelab is a structured guide that shows how to build a simple Python command-line application using the Drive API. Its content can also be used as a model for using other Google Workspace and Google APIs.

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.

ZIP Extractor

ZIP Extractor is a JavaScript implementation of a utility for opening and extracting ZIP files into Google Drive. The example contains working code necessary for:

To get started, try the app or install it in Drive. To see how it all works, get the source from the Google Drive GitHub repo.


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.

The source for the example is available on GitHub.