G Suite & Google APIs coding workshop

Preview:

Citation preview

PyConMay 2016: Portland, OR

BayPIGgiesAug 2016: Mountain View, CA

Exploring G Suite & Google APIs(coding workshop; samples in Python)

+Wesley Chun, @wescpyDeveloper Advocate

Can't wait? pip{,3} install -U google-api-python-clientAND console.developers.google.com

SF Python project nightOct 2016: San Francisco, CA

GDG NYC meetupNov 2016: New York, NY

Outline

● Overview● Getting started● Authorization boilerplate● Motivational ideas● Wrap-up● [hacking + API usage examples]

Google APIs overview

BUT... wait, there’s more...

Getting Started with Google APIs

Developers Console (devconsole)

OAuth2 scenarios● Varies on application type (where apps located)

○ Web (server) applications○ Installed (mobile & desktop computers) apps○ Service accounts (cloud/server-to-server)○ Client-side (JavaScript) apps○ Limited-input devices (game consoles, printers, cameras, etc.)

○ developers.google.com/identity/protocols/OAuth2○ TODAY: command-line script == "Installed"

Authorization boilerplate

developers.google.com/discovery/libraries

Open source client libraries for many

languages, not just

SIMPLE

AUTHORIZED

Which do you choose?

Simple API access

Authorized API access

Motivational ideas

Write your own or see github.com/googledrive/zipextractor (JS)

Build a Node.js customized reporting tool with our Sheets API codelab at g.co/codelabs/sheets (JS)

Check out our Node.js Markdown-to-Google Slides sample app demoing the Slides API

github.com/googlesamples/md2googleslides (JS)

Wrap-up

Alternative● Google Apps Script

○ What is it?■ Executes as JavaScript in Google's cloud■ Think “built-in” services vs. traditional API usage■ Convenient access to G Suite/Google Apps data■ Can also access other Google+external services■ developers.google.com/apps-script

○ Video resources■ goo.gl/1sXeuD (Apps Script intro)■ goo.gl/oAzBN9 (Google Maps & Gmail APIs)■ goo.gl/YuwZ0E (YouTube [Data] API)■ goo.gl/xSzGl4 (Google Forms)

Summary

● We’ve created great tech but can’t build everything(!)● APIs: our tech available for your apps; free?!?● Access w/favorite dev tool via Google APIs Client Library

○ Python, JavaScript (client + Node.js), Java, C#/.NET, Go, Dart, Ruby, PHP

○ Also mobile: Android (Java), iOS (Swift, Objective-C)● Build the next great thing!

Reference● Blog + video Resources○ SETUP & BOILERPLATE

■ goo.gl/RbyTFD (new Google APIs project setup)■ goo.gl/KMfbeK (common Python boilerplate code review)

○ G SUITE APIs■ goo.gl/ZIgf8k and goo.gl/EySSQV (Google Drive API)■ goo.gl/pFYUQ2 (Gmail API)■ goo.gl/KuYMiq (Google Calendar API)■ goo.gl/N1RPwC and goo.gl/U6Oljn (Google Sheets API)■ goo.gl/o6EFwk (Google Slides API)■ goo.gl/Yb06ZC (Google Sheets & Slides APIs)

Thank you! Questions?

+Wesley Chungoogle.com/+WesleyChun

@wescpytwitter.com/wescpy

slide deckgoo.gl/NjCC0H