Skip to content

googleworkspace/gsuite-apis-intro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Workspace APIs Intro codelab

This codelab introduces developers to Google Workspace (formerly G Suite) APIs (Gmail, Google Drive, Calendar, Sheets, Slides, etc.) by writing a simple Python script that lists the first 100 files/folders in a user's Google Drive. Access it at http://g.co/codelabs/gsuite-apis-intro.

Prerequisites

  • A Google account (Google Workspace accounts may require administrator approval)
  • Familiarity with shell commands on POSIX-compliant systems (Linux, Mac OS X); Windows users also welcome
  • Ability to create source files with either a code editor or shell commands.
  • Basic skills in Python (2 or 3), but you use any supported language
  • Some files and/or folders in your Google Drive

Description

This repo is part of the codelab introducing developers to using Google Workspace (REST/HTTP) APIs. The example will be done in Python for brevity and wide availability, but all common languages are supported. The tutorial shows how to use the developer console to create and manage projects, including obtaining the credentials needed in your apps, then moves on to the primary code sample that displays the first 100 files & folders in your Google Drive by using the Drive API.

Caveat

oauth2client library deprecated: The oauth2client library was deprecated in 2017 in favor of newer replacements. However the newer libraries do not yet support either user authorization nor user credentials storage, two features that are required in this codelab. When those features become available, we will migrate to the newer libraries. For now, oauth2client still works, even in maintenance mode, and provides automated, threadsafe, and 2.x/3.x-compatible storage of and access to OAuth2 tokens for users whereas the newer libraries do not (yet).

Cost

Use of the Google Drive API (and most Google Workspace APIs) are covered by a monthly subscription fee, including the free consumer Google/Gmail accounts (monthly fee of $0USD), meaning you can use the APIs as long as you stay within each API's daily/monthly limits. Exceeding the limits will result in failed requests/exceptions. Some APIs have a support page to request additional quota.

Repo files

Filename Description
drive_list.py The original sample app as featured in codelab
drive_list-new.py Same as drive_list.py but uses newer auth libraries (not threadsafe nor easily Python 2-3 compatible nor handles auth tokens [extra JSON storage code])

Support

If you've found an error in the codelab or the sample app, check the Issues tab to see if there's an open issue or file a new one. Patches are encouraged; please refer to CONTRIBUTING for details.

Releases

No releases published

Packages

No packages published

Languages