7. What you can do with it?
Automate repetitive processes and workflows
Link Google products with third party services
Create custom spreadsheet functions
Build rich GUI and menus
10. Google Apps Script Security
Model
Grant access needed to any scripts you run that accesses
private data
Script permission level and access
Standalone scripts
Container-bound scripts
Container owner
Container editor
Container viewer
11. Building your first script
We will create standalone script
There are two ways to create a new standalone script:
From Google Drive, choose Create > More > Script
Go to https://script.google.com
12. Building your first script
Let’s try to create a simple one:
create a new Google Docs
email you a link to the newly created document
13.
14. Executing a script
Script editor
Custom function in a spreadsheet
Web app
Gadget in Google sites
Container extension
Time-driven trigger
Container-specific trigger
19. Events and Triggers
Events: action that happens when the state of an
object changes
Clock tick events
Script installation events
Spreadsheet open events
Spreadsheet edit events
Spreadsheet form submit events
20. Events and Triggers
Trigger: type of script resource that listens to a
particular event and executes a function when that
event fires
22. Application API
Allow developers to write applications that access
Google Applications: Gmail, Calendar, and many others
using Google Data APIs, Gadgets and Google Apps
Script
Based on JSON and Atom and RSS syndication
formats and the Atom publishing protocol
23. Application APIs
Calendar API
Tasks API
Gmail API
Contacts API
Document List API
Spreadsheet API
Site API
24. Prerequisites
Get a Google Account
Try out Google apps (Calendar, Contacts, Docs, etc)
Register your project, visit APIs Console (https://
code.google.com/apis/console)
Learn about REST
Learn about JSON data format
25. Invoke the API
Using REST directly
Using client libraries
28. Calendar API
Lets you develop client applications that create new
events, edit or delete existing events, and search for
events
Integrates your apps with Google Calendar, suits for
apps that need to display Calendar and synchronizes it
with Google Calendar
Uses JSON starting on v3
29. Tasks API
provides developers with a powerful set of API
endpoints for searching, reading, and updating Google
Tasks content and metadata
Various integration projects with web apps or other
Google APIs, use Google Task API to manage Google
task lists in a mobile app
30. Gmail API
Help you and your users interact with, configure, and extend Gmail
Some possibilities:
Gadgets
OAuth Access to IMAP or SMTP
IMAP Extension
Gmail Inbox Feed
Email Migration API
Email Settings API
31. Contacts API
Allows client applications to create, edit or delete user’s
contacts
Supports protocol (via curl or wget), Java, .NET and
Python
32. Document List API
Allows developer to create, retrieve, update and delete
Google Docs
Included advanced features like resource archives,
OCR (Optical Character Recognition), translation and
revision history
Useful for storing data in the cloud, perform resource
management, convert document formats, etc
34. Spreadsheets API
Common examples:
Computing financial data stored in an inaccessible
system
Presenting statistics to users in a web browser
Consuming data entered into a spreadsheet by a
user
35. Sites API
Allows client applications to access, publish, and
modify content within a Google Site
Access and modify Google Site data using Google
Data API feeds
40. OAuth 2.0
Four steps of accessing Google API using OAuth 2.0:
1. Register application
2. Obtain an access token from the Google
Authorization Server
3. Send the Access Token
4. Refresh the Access Token
44. Domain Admin APIs
Allows developers to write applications to manage
Google Apps domains
Migrate from and integrate with existing IT
infrastructure, create users, update settings, audit
activity and more
Based on JSON for Admin Audit API and Groups
Settings API, others are based on RSS syndication
formats
45. Domain Admin API
Audit API Email Migration API
Admin Audit API Email Settings API
Email Audit API Groups Settings API
Admin Settings API Provisioning API
Calendar Resource API Reporting API
Shared Contacts API User Profiles API
script properties:\n- key-value pairs yg disimpan oleh script pad suatu persistent store\n- key-value pairs yang unik berdasarkan user\nScriptDB:\n- js object database for GApps\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
gadgets:\n- sidebar gadgets: small, portable web app that live in the lef-hand side of the Gmail UI\n- contextual gadgets: applications displayed at the bottom of individual email messages and are triggered by contextual clues\n\n
contact entry\nretrieving all contacts\nretrieving contacts using query parameters\nretrieving a single contact\ncreating contacts\ncontact photo management\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
code or token\nthe client_id obtained from the API Console\none of your redirect_uri registered\nspace delimited set o permissions the app req\nany string\n