Calendar Example http://www.google.com/calendar/feeds/default/private/full2011-10-25T16:06:40.000Zsbazyl@google.com[email protected]Steven Bazyl...Google Calendar generator> 2008125
This is all just preamble. We haven’t seen a calendar event yet!
Challenges for Developers
Challenges for Developers ➡ Requires knowledge/expertise in adjunct specifications
Challenges for Developers ➡ Requires knowledge/expertise in adjunct specifications ➡ Verbose data representation
Challenges for Developers ➡ Requires knowledge/expertise in adjunct specifications ➡ Verbose data representation ➡ XML not easy on some platforms
Challenges for Developers ➡ Requires knowledge/expertise in adjunct specifications ➡ Verbose data representation ➡ XML not easy on some platforms ➡ Client libraries out of date, missing on some platforms
Challenges for Developers ➡ Requires knowledge/expertise in adjunct specifications ➡ Verbose data representation ➡ XML not easy on some platforms ➡ Client libraries out of date, missing on some platforms ➡ Inconsistent feature sets
New API Stack
New API Stack
HTTPS
Protocol
New API Stack
OAuth 1.0
OAuth 2.0 HTTPS
Auth Protocol
New API Stack
CSV
ATOM
XML
OAuth 1.0
JSON OAuth 2.0
HTTPS
Data Format Auth Protocol
New API Stack
JSON
JSON
OAuth 2.0 OAuth 2.0 HTTPS
Data Format Auth Protocol
New API Stack
That’s it. JSON
JSON
OAuth 2.0 OAuth 2.0 HTTPS
Data Format Auth Protocol
Feature Consistency
Calendar
Contacts
Docs
...
Before: Each API had it’s own configuration of features
Feature Consistency
Calendar
Contacts
Docs
...
Before: Each API had it’s own configuration of features
Feature Consistency
Calendar
Contacts
Docs
...
Before: Each API had it’s own configuration of features
Feature Consistency
Calendar
Contacts
Docs
...
Before: Each API had it’s own configuration of features
Feature Consistency
Calendar
Contacts
Docs
...
Before: Each API had it’s own configuration of features
Feature Consistency
Calendar
Contacts
Docs
...
Before: Each API had it’s own configuration of features
After: Common stack, new features applied consistently across APIs
Available APIs • Lots of Google APIs already using this model. –Google+, Prediction, etc. • Google Apps: –Task API v1 –Calendar V3 soon –Others...eventually
Simpler Data Format { • Default format is JSON • Easy to construct, parse, and Text comprehend
Client Libraries - Discovery • Dynamic Discovery –JSON object –Describes resources, URLs, verbs, parameters, (schemas) –Always up to date –Discovery is just another API! https://www.googleapis.com/discovery/v1/apis
Client Libraries • “Generic” client libraries – Discover resources, URL templates, verbs – Use simple classes to represent resources – Generated POJOs to map JSON for strongly typed languages
PHP tasks = service.tasks() .list(tasklist = ‘@default’) .execute() for task in tasks[‘items’]: print task[‘title’] }
Generated classes for Java, .NET
Simple hashes for PHP, Python, Ruby, etc.
APIs Explorer
https://code.google.com/apis/explorer/
API Console
https://code.google.com/apis/console
Apps Script
Apps Script 101 • Javascript engine in the cloud, running on Google infrastructure • Great for workflow, process automation
Available APIs Google Apps Calendar Contacts Docs List Documents Spreadsheets Gmail Sites Tasks
Google APIs Finance BigQuery Url Shortener Prediction Translation
User Interface
Maps Charts GWT & UI Builder
Connectivity SOAP HTTP JDBC
Utilities
Logging User/Script Properties XML
Gmail Service • If you use Gmail, you already know the API –Compose –Inbox –Starred –Sent Mail –Labels –Search
GmailApp
GmailApp • There are just 3 objects: –GmailThread –GmailMessage –GmailLabel
GmailApp • There are just 3 objects: –GmailThread –GmailMessage –GmailLabel • Threads are composed of messages
GmailApp • There are just 3 objects: –GmailThread –GmailMessage –GmailLabel • Threads are composed of messages • Each thread can have multiple labels
GmailApp function getEmails() { var threads = GmailApp.search( ‘in:inbox is:unread’); var messages = []; for (var t in threads) { for (var m in t.getMessages()) { messages.push(m); } } return messages; }
DocumentApp
DocumentApp • Create a new document: –DocumentApp.create (name)
DocumentApp • Create a new document: –DocumentApp.create (name) • Open an existing document: –DocumentApp.openById (id)
DocumentApp • Create a new document: –DocumentApp.create (name) • Open an existing document: –DocumentApp.openById (id) • Documents are composed of elements: – DocumentBody – Paragraphs – Headers – Footers – ListItems – Tables
DocumentApp - Templates
Processing a template function processTemplate(templateId, values) { var newId = DocsList.getFileById(templateId) .makeCopy().getId(); var doc = DocumentApp.openById(newId); var body = doc.getActiveSection(); for (var key in values) { body.replaceText("%"+key+"%", values[key]); } return doc; }
Charts API // Build the chart. var chart = Charts.newColumnChart() .setDataTable(dataTable) .setColors(["green", "red"]) .setDimensions(600, 400) .setXAxisTitle("Quarters") .setYAxisTitle("$") .setTitle("Income and Expenses") .build();
UI Builder
Referencing UI Components function doGet() { var app = UiApp.createApplication(); var component = app.loadComponent ("MyGui"); app.add(component); return app; }
Demo - http://goo.gl/nKOhN
Even more new things! New APIs: • Big Query • Prediction • Tasks • URL Shortener
Picker API
Picker API
Picker API
Picker API • Implicit OAuth 2 access token for selected docs
var doc = data.docs[0]; var accessToken = doc.accessToken; var resourceId = google.picker.ResourceId.generate(doc); ... • Localization
google.load('picker', '1' {'language':'fr'}); • Picasa Web Albumbs, Image Search, Video Search too!
Distribution
Google Apps Marketplace
What’s new in the Marketplace
What’s new in the Marketplace • Installable apps for individual users
What’s new in the Marketplace • Installable apps for individual users • “Staff Picks” feature in the home page
What’s new in the Marketplace • Installable apps for individual users • “Staff Picks” feature in the home page • Improved searching & analytics
Single Sign-On
Single Sign-On
Many integration Points
Domain Users & Groups
Calendar
Contacts
Documents List
Sites
Spreadsheets
Gmail IMAP+SMTP
Gadgets
Summary
Summary • 100% cloud for business • Google Apps just part of the solution, need additional solutions from developers like you • Lots of tools available! –Apps APIs like tasks, contacts, calendar, etc –Apps Script for automation & workflow –Easy doc integration with Picker API • Distribution options via Google Apps Marketplace