SlideShare a Scribd company logo
1 of 38
Google Drive and the
Google Drive SDK
Building Drive apps
Abdelhalim Lagrid
Google Developer Group, Algiers
1
Introduction :
One of Cloud google’s products : lunched in 2012 ..known by Google
Drive API .
What is Google Drive?
Yea, some marketing :)

2222
Access Anywhere
Google Drive is everywhere you are -- on the
web, in your home, at the office, and on the go.
So wherever you are, your stuff is just...there.
Ready to go, ready to share.
Install it on:

PC, Mac, Android, iOS
Store your files in a safe place

Things happen. Your phone goes for a swim.
Your laptop takes an infinite snooze.
No matter what happens to your devices, your
files are safely stored in Google Drive.
Powerful search

Google Drive can search keywords
in your files -- even the text in
pictures -- to help you quickly find
what you're looking for.
View anything

When a coworker shares a file with
you, you may not have the supported
software on your computer. With
Google Drive you can open and view
over 35 file types directly in the
browser.
Access to a world of apps!
Google Drive works with the apps
that make you more efficient.
Choose from a growing set of
productivity applications, integrated
right into your Drive.
Google Drive SDK
Why integrate with Google Drive?
Drive SDK opportunity

++
Extensive Reach
Put your app in front of millions of
users with billions of files

Effortless Integration
Get the best of Google Drive's sharing
capabilities, storage capacity and user
identity management so you can focus
on your app
Drive SDK features

Drive
•
•

Create, Read, List, Manage files through the API
Search, sharing and revisions

Drive Web UI
•

Open files and docs with your app directly from Drive
Integrating with Google Drive
Getting Started
Steps for integrating your app w/ Drive

Prerequisites:
• Create a project in the Google APIs Console
• Enable the Drive API
• Create OAuth 2.0 credentials

Integration steps:
• Auth with OAuth 2.0 [& OpenID Connect]
• Write code for opening / saving / managing files
OAuth 2.0
Introduction
A cool tool...

OAuth 2.0 Playground
Integrating with Google Drive
Handling Authorization for Web apps
Authorization
Using OAuth 2.0 - Redirecting users to the Grant screen
Python

decorator = OAuth2Decorator(client_id=settings.CLIENT_ID,
client_secret=settings.CLIENT_SECRET,
scope=settings.SCOPE,
user_agent='we-cloud')
class Documents(webapp.RequestHandler):
@decorator.oauth_required
def get(self):
user = users.get_current_user()
if user:
service = build('drive', 'v2', http=decorator.http())
Integrating with Google Drive
Interacting with Drive files
Instantiating the Drive service Object

Python

# Here is the Drive service
service = build('drive', 'v2', http=decorator.http())
Creating Folders

Python

folder = {
'title': self.request.get('project[name]'),
'mimeType': 'application/vnd.google-apps.folder'
}
created_folder = service.files().insert(body=folder).execute()
projectcollectionid = created_folder['id']
Creating Files

Python

mimetype = 'application/vnd.google-apps.' + self.request.get('doc[type]')
document = {
'title': self.request.get('doc[name]'),
'mimeType': mimetype
}
if projectcollectionid:
document['parents'] = [{'id': projectcollectionid}]
created_document = service.files().insert(body=document).execute()
resourceid = created_document['id']
Sharing Files

Python

#Share the file with other members
new_permission = {
'value': email,
'type': 'user',
'role': 'writer'
}
service.permissions().insert(fileId=fileid, body=new_permission).execute()
Searching for files
def retrieve_all_files(service,query):
result = []
page_token = None
param = {}
param['q'] = "fullText contains '"+ query + "'"
param['fields'] = "items(id,parents/id)"
while True:
try:
if page_token:
param['pageToken'] = page_token
files = service.files().list(**param).execute()
result.extend(files['items'])
page_token = files.get('nextPageToken')
if not page_token:
break
except errors.HttpError, error:

Python
Integrating with Google Drive
Adding the Drive Web-UI Integration
UI Integration - "Create"
UI Integration - "Open with"
Distribution - Chrome Web Store
Steps for adding Drive UI integration

Prerequisites:
• Create a Chrome Web Store listing

(Painful !)

• Install the application from the CWS
• Enable and configure the Drive SDK in the Google APIs Console

Integration steps:
• Support OAuth 2.0 server-side flow
• Read action and file ID from URL parameter
Passing context on open & create
What happens when somebody launches your app from Drive?
URL

https://www.yourapp.com/drive?code=<authorization code>&state=<JSON>

JSON

{
"action" : "create",
"parentId" : "0ADK06pfg"

Create actions

"action" : "open",
"ids" : ["0Bz0bd"]

Open actions

}
{

}
Integrating with Google Drive
The Google Picker
UI Integration - Embedded file picker
Embedding the picker
JS

google.setOnLoadCallback(createPicker);
google.load('picker', '1');
var view = new google.picker.View(google.picker.ViewId.DOCS);
view.setMimeTypes("image/png,image/jpeg,image/jpg");

function createPicker() {
picker = new google.picker.PickerBuilder()
.enableFeature(google.picker.Feature.MULTISELECT_ENABLED)
.setAppId(YOUR_APP_ID)
.addView(view)
.setCallback(pickerCallback)
.build();
picker.setVisible(true);
Handling picker selections
JS

// A simple callback implementation.
function pickerCallback(data) {
if (data.action == google.picker.Action.PICKED) {
var fileId = data.docs[0].id;
alert('The user selected: ' + fileId);
}
}
Other features
Other Features / tips & tricks
•
•
•
•
•
•
•
•
•
•
•

Resumable upload & download
Indexable text
Search!
Conversions to native Google Documents
Export of native Google Documents in many formats
OCR
Revisions
List installed apps
Copy files, Trash files, Touch files
User Permissions
Shortcuts
o Auto-generated MIME type
o Contentless
<Thank You!>
http://developers.google.com/drive

h.lagrid@gmail.com
Google Drive & Google Drive SDK

More Related Content

What's hot

Google drive powerpoint
Google drive powerpointGoogle drive powerpoint
Google drive powerpointCory Lincourt
 
Learn more about what google drive can do
Learn more about what google drive can doLearn more about what google drive can do
Learn more about what google drive can doAisha_78
 
What is google drive
What is google driveWhat is google drive
What is google driveLeAnn Waldie
 
Google drive
Google driveGoogle drive
Google driveSamraZain
 
10 Amazing Things You Could Do With Google Drive
10 Amazing Things You Could Do With Google Drive10 Amazing Things You Could Do With Google Drive
10 Amazing Things You Could Do With Google DrivePraveen Jose
 
Google drive & docs
Google drive & docsGoogle drive & docs
Google drive & docsUES
 
Slide presentation on introduction to google drive february 2014 revised again b
Slide presentation on introduction to google drive february 2014 revised again bSlide presentation on introduction to google drive february 2014 revised again b
Slide presentation on introduction to google drive february 2014 revised again bRita Ndagire Kizito
 
Almost all about Google Drive
Almost all about Google DriveAlmost all about Google Drive
Almost all about Google DrivePlusOrMinusZero
 
Beginner's Guide to Google Drive
Beginner's Guide to Google DriveBeginner's Guide to Google Drive
Beginner's Guide to Google Drivejanice almada
 
Introduction to Google Drive & Safe Assign
Introduction to Google Drive & Safe AssignIntroduction to Google Drive & Safe Assign
Introduction to Google Drive & Safe AssignGreg Quinlivan
 
Google Drive (for dummies)
Google Drive (for dummies)Google Drive (for dummies)
Google Drive (for dummies)Dom Cushnan
 
Google drive
Google driveGoogle drive
Google driveTeddmosby
 
Google drive &amp; docs
Google drive &amp; docsGoogle drive &amp; docs
Google drive &amp; docsrodolfo romo
 
Introduction to Google Drive API
Introduction to Google Drive APIIntroduction to Google Drive API
Introduction to Google Drive APIJomar Tigcal
 
Upload files and folders to Google Drive
Upload files and folders to Google DriveUpload files and folders to Google Drive
Upload files and folders to Google DriveBridgePaSchool
 
How To Use Google Docs & Share Files - Belinda Bagatsing - digitalthinkingbee
How To Use Google Docs & Share Files - Belinda Bagatsing - digitalthinkingbeeHow To Use Google Docs & Share Files - Belinda Bagatsing - digitalthinkingbee
How To Use Google Docs & Share Files - Belinda Bagatsing - digitalthinkingbeedigitalthinkingbee.com
 

What's hot (20)

Google drive powerpoint
Google drive powerpointGoogle drive powerpoint
Google drive powerpoint
 
Collaborative Tools and LinkedIn
Collaborative Tools and LinkedInCollaborative Tools and LinkedIn
Collaborative Tools and LinkedIn
 
Learn more about what google drive can do
Learn more about what google drive can doLearn more about what google drive can do
Learn more about what google drive can do
 
What is google drive
What is google driveWhat is google drive
What is google drive
 
Google drive
Google driveGoogle drive
Google drive
 
10 Amazing Things You Could Do With Google Drive
10 Amazing Things You Could Do With Google Drive10 Amazing Things You Could Do With Google Drive
10 Amazing Things You Could Do With Google Drive
 
Google drive & docs
Google drive & docsGoogle drive & docs
Google drive & docs
 
Slide presentation on introduction to google drive february 2014 revised again b
Slide presentation on introduction to google drive february 2014 revised again bSlide presentation on introduction to google drive february 2014 revised again b
Slide presentation on introduction to google drive february 2014 revised again b
 
Almost all about Google Drive
Almost all about Google DriveAlmost all about Google Drive
Almost all about Google Drive
 
Beginner's Guide to Google Drive
Beginner's Guide to Google DriveBeginner's Guide to Google Drive
Beginner's Guide to Google Drive
 
google drive
google drivegoogle drive
google drive
 
Introduction to Google Drive & Safe Assign
Introduction to Google Drive & Safe AssignIntroduction to Google Drive & Safe Assign
Introduction to Google Drive & Safe Assign
 
Google Drive (for dummies)
Google Drive (for dummies)Google Drive (for dummies)
Google Drive (for dummies)
 
Google drive presentation
Google drive presentationGoogle drive presentation
Google drive presentation
 
Google drive
Google driveGoogle drive
Google drive
 
Google drive &amp; docs
Google drive &amp; docsGoogle drive &amp; docs
Google drive &amp; docs
 
Google drive &amp; docs
Google drive &amp; docsGoogle drive &amp; docs
Google drive &amp; docs
 
Introduction to Google Drive API
Introduction to Google Drive APIIntroduction to Google Drive API
Introduction to Google Drive API
 
Upload files and folders to Google Drive
Upload files and folders to Google DriveUpload files and folders to Google Drive
Upload files and folders to Google Drive
 
How To Use Google Docs & Share Files - Belinda Bagatsing - digitalthinkingbee
How To Use Google Docs & Share Files - Belinda Bagatsing - digitalthinkingbeeHow To Use Google Docs & Share Files - Belinda Bagatsing - digitalthinkingbee
How To Use Google Docs & Share Files - Belinda Bagatsing - digitalthinkingbee
 

Viewers also liked

iOS Google Sign In
iOS Google Sign IniOS Google Sign In
iOS Google Sign Inapgeek
 
Keystone College Students’ Perceptions of Career Development and Use of Caree...
Keystone College Students’ Perceptions of Career Development and Use of Caree...Keystone College Students’ Perceptions of Career Development and Use of Caree...
Keystone College Students’ Perceptions of Career Development and Use of Caree...Joseph Croft
 
An Engineers Guide to the AWS Ruby SDK
An Engineers Guide to the AWS Ruby SDKAn Engineers Guide to the AWS Ruby SDK
An Engineers Guide to the AWS Ruby SDK😸 Richard Spindler
 
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIsDreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIsHormoz Tarevern
 
#MBLTdev: Разработка первоклассных SDK для Android (Twitter)
#MBLTdev: Разработка первоклассных SDK для Android (Twitter)#MBLTdev: Разработка первоклассных SDK для Android (Twitter)
#MBLTdev: Разработка первоклассных SDK для Android (Twitter)e-Legion
 
google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdkfirenze-gtug
 
Facebook Python SDK - Introduction
Facebook Python SDK - IntroductionFacebook Python SDK - Introduction
Facebook Python SDK - IntroductionColin Su
 

Viewers also liked (8)

iOS Google Sign In
iOS Google Sign IniOS Google Sign In
iOS Google Sign In
 
Keystone College Students’ Perceptions of Career Development and Use of Caree...
Keystone College Students’ Perceptions of Career Development and Use of Caree...Keystone College Students’ Perceptions of Career Development and Use of Caree...
Keystone College Students’ Perceptions of Career Development and Use of Caree...
 
An Engineers Guide to the AWS Ruby SDK
An Engineers Guide to the AWS Ruby SDKAn Engineers Guide to the AWS Ruby SDK
An Engineers Guide to the AWS Ruby SDK
 
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIsDreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
 
#MBLTdev: Разработка первоклассных SDK для Android (Twitter)
#MBLTdev: Разработка первоклассных SDK для Android (Twitter)#MBLTdev: Разработка первоклассных SDK для Android (Twitter)
#MBLTdev: Разработка первоклассных SDK для Android (Twitter)
 
google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdk
 
An In-Depth Look at Junos Space SDK
An In-Depth Look at Junos Space SDKAn In-Depth Look at Junos Space SDK
An In-Depth Look at Junos Space SDK
 
Facebook Python SDK - Introduction
Facebook Python SDK - IntroductionFacebook Python SDK - Introduction
Facebook Python SDK - Introduction
 

Similar to Google Drive & Google Drive SDK

Ict google drive report
Ict google drive reportIct google drive report
Ict google drive reportSEANROMMEL
 
Integrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps ScriptIntegrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps ScriptArun Nagarajan
 
Powerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hackPowerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hackwesley chun
 
Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to presentwesley chun
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewwesley chun
 
Build with ALL of Google Cloud
Build with ALL of Google CloudBuild with ALL of Google Cloud
Build with ALL of Google Cloudwesley chun
 
Cloud computing
Cloud computingCloud computing
Cloud computingJo Esc
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...e-Legion
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIswesley chun
 
Cloud computing overview & Technical intro to Google Cloud
Cloud computing overview & Technical intro to Google CloudCloud computing overview & Technical intro to Google Cloud
Cloud computing overview & Technical intro to Google Cloudwesley chun
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platformAnkit Malviya
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptwesley chun
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloudwesley chun
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_authlzongren
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...wesley chun
 
Entrepreneurship Tips With HTML5 & App Engine Startup Weekend (June 2012)
Entrepreneurship Tips With HTML5 & App Engine Startup Weekend (June 2012)Entrepreneurship Tips With HTML5 & App Engine Startup Weekend (June 2012)
Entrepreneurship Tips With HTML5 & App Engine Startup Weekend (June 2012)Ido Green
 
CloudOps evening presentation from Google
CloudOps evening presentation from GoogleCloudOps evening presentation from Google
CloudOps evening presentation from GoogleAlistair Croll
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIswesley chun
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloudwesley chun
 

Similar to Google Drive & Google Drive SDK (20)

google drive
google drivegoogle drive
google drive
 
Ict google drive report
Ict google drive reportIct google drive report
Ict google drive report
 
Integrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps ScriptIntegrate Google Drive with Google Apps Script
Integrate Google Drive with Google Apps Script
 
Powerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hackPowerful Google Cloud tools for your hack
Powerful Google Cloud tools for your hack
 
Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to present
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overview
 
Build with ALL of Google Cloud
Build with ALL of Google CloudBuild with ALL of Google Cloud
Build with ALL of Google Cloud
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIs
 
Cloud computing overview & Technical intro to Google Cloud
Cloud computing overview & Technical intro to Google CloudCloud computing overview & Technical intro to Google Cloud
Cloud computing overview & Technical intro to Google Cloud
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platform
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloud
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
 
Entrepreneurship Tips With HTML5 & App Engine Startup Weekend (June 2012)
Entrepreneurship Tips With HTML5 & App Engine Startup Weekend (June 2012)Entrepreneurship Tips With HTML5 & App Engine Startup Weekend (June 2012)
Entrepreneurship Tips With HTML5 & App Engine Startup Weekend (June 2012)
 
CloudOps evening presentation from Google
CloudOps evening presentation from GoogleCloudOps evening presentation from Google
CloudOps evening presentation from Google
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloud
 

Recently uploaded

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

Google Drive & Google Drive SDK

  • 1.
  • 2. Google Drive and the Google Drive SDK Building Drive apps Abdelhalim Lagrid Google Developer Group, Algiers 1
  • 3. Introduction : One of Cloud google’s products : lunched in 2012 ..known by Google Drive API .
  • 4. What is Google Drive? Yea, some marketing :) 2222
  • 5. Access Anywhere Google Drive is everywhere you are -- on the web, in your home, at the office, and on the go. So wherever you are, your stuff is just...there. Ready to go, ready to share. Install it on: PC, Mac, Android, iOS
  • 6. Store your files in a safe place Things happen. Your phone goes for a swim. Your laptop takes an infinite snooze. No matter what happens to your devices, your files are safely stored in Google Drive.
  • 7. Powerful search Google Drive can search keywords in your files -- even the text in pictures -- to help you quickly find what you're looking for.
  • 8. View anything When a coworker shares a file with you, you may not have the supported software on your computer. With Google Drive you can open and view over 35 file types directly in the browser.
  • 9. Access to a world of apps! Google Drive works with the apps that make you more efficient. Choose from a growing set of productivity applications, integrated right into your Drive.
  • 10. Google Drive SDK Why integrate with Google Drive?
  • 11. Drive SDK opportunity ++ Extensive Reach Put your app in front of millions of users with billions of files Effortless Integration Get the best of Google Drive's sharing capabilities, storage capacity and user identity management so you can focus on your app
  • 12. Drive SDK features Drive • • Create, Read, List, Manage files through the API Search, sharing and revisions Drive Web UI • Open files and docs with your app directly from Drive
  • 13. Integrating with Google Drive Getting Started
  • 14. Steps for integrating your app w/ Drive Prerequisites: • Create a project in the Google APIs Console • Enable the Drive API • Create OAuth 2.0 credentials Integration steps: • Auth with OAuth 2.0 [& OpenID Connect] • Write code for opening / saving / managing files
  • 16. A cool tool... OAuth 2.0 Playground
  • 17. Integrating with Google Drive Handling Authorization for Web apps
  • 18. Authorization Using OAuth 2.0 - Redirecting users to the Grant screen Python decorator = OAuth2Decorator(client_id=settings.CLIENT_ID, client_secret=settings.CLIENT_SECRET, scope=settings.SCOPE, user_agent='we-cloud') class Documents(webapp.RequestHandler): @decorator.oauth_required def get(self): user = users.get_current_user() if user: service = build('drive', 'v2', http=decorator.http())
  • 19. Integrating with Google Drive Interacting with Drive files
  • 20. Instantiating the Drive service Object Python # Here is the Drive service service = build('drive', 'v2', http=decorator.http())
  • 21. Creating Folders Python folder = { 'title': self.request.get('project[name]'), 'mimeType': 'application/vnd.google-apps.folder' } created_folder = service.files().insert(body=folder).execute() projectcollectionid = created_folder['id']
  • 22. Creating Files Python mimetype = 'application/vnd.google-apps.' + self.request.get('doc[type]') document = { 'title': self.request.get('doc[name]'), 'mimeType': mimetype } if projectcollectionid: document['parents'] = [{'id': projectcollectionid}] created_document = service.files().insert(body=document).execute() resourceid = created_document['id']
  • 23. Sharing Files Python #Share the file with other members new_permission = { 'value': email, 'type': 'user', 'role': 'writer' } service.permissions().insert(fileId=fileid, body=new_permission).execute()
  • 24. Searching for files def retrieve_all_files(service,query): result = [] page_token = None param = {} param['q'] = "fullText contains '"+ query + "'" param['fields'] = "items(id,parents/id)" while True: try: if page_token: param['pageToken'] = page_token files = service.files().list(**param).execute() result.extend(files['items']) page_token = files.get('nextPageToken') if not page_token: break except errors.HttpError, error: Python
  • 25. Integrating with Google Drive Adding the Drive Web-UI Integration
  • 26. UI Integration - "Create"
  • 27. UI Integration - "Open with"
  • 29. Steps for adding Drive UI integration Prerequisites: • Create a Chrome Web Store listing (Painful !) • Install the application from the CWS • Enable and configure the Drive SDK in the Google APIs Console Integration steps: • Support OAuth 2.0 server-side flow • Read action and file ID from URL parameter
  • 30. Passing context on open & create What happens when somebody launches your app from Drive? URL https://www.yourapp.com/drive?code=<authorization code>&state=<JSON> JSON { "action" : "create", "parentId" : "0ADK06pfg" Create actions "action" : "open", "ids" : ["0Bz0bd"] Open actions } { }
  • 31. Integrating with Google Drive The Google Picker
  • 32. UI Integration - Embedded file picker
  • 33. Embedding the picker JS google.setOnLoadCallback(createPicker); google.load('picker', '1'); var view = new google.picker.View(google.picker.ViewId.DOCS); view.setMimeTypes("image/png,image/jpeg,image/jpg"); function createPicker() { picker = new google.picker.PickerBuilder() .enableFeature(google.picker.Feature.MULTISELECT_ENABLED) .setAppId(YOUR_APP_ID) .addView(view) .setCallback(pickerCallback) .build(); picker.setVisible(true);
  • 34. Handling picker selections JS // A simple callback implementation. function pickerCallback(data) { if (data.action == google.picker.Action.PICKED) { var fileId = data.docs[0].id; alert('The user selected: ' + fileId); } }
  • 36. Other Features / tips & tricks • • • • • • • • • • • Resumable upload & download Indexable text Search! Conversions to native Google Documents Export of native Google Documents in many formats OCR Revisions List installed apps Copy files, Trash files, Touch files User Permissions Shortcuts o Auto-generated MIME type o Contentless