Skip to content

Instantly share code, notes, and snippets.

@jsgao0
Last active July 11, 2016 05:07
Show Gist options
  • Save jsgao0/b4f787ca589131200215ab57aacbcc68 to your computer and use it in GitHub Desktop.
Save jsgao0/b4f787ca589131200215ab57aacbcc68 to your computer and use it in GitHub Desktop.
Retrieve File From Google Drive Using Google Drive v2.
<html>
<head>
<script>
function driveRequest() {
var request = gapi.client.drive.files.get({
'fileId': 'File ID'
});
request.then(function(response) {
// response is the result.
});
}
function init() {
gapi.client.setApiKey('Your API Key');
gapi.client.load('drive', 'v2').then(driveRequest);
}
</script>
<script src="https://apis.google.com/js/client.js?onload=init"></script>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment