Google Drive integration with private website - google-drive-api

I would like to integrate Google Drive with my private website in such way that user will provide my website with his own Google Drive, and he could perform on my website such actions as: viewing, deleting, adding or editing files. Is is possible? What is needed to do such integration?
I read Google Drive API documentation and I checked it is possible to perform such actions as creating, reading, editing files. But I have no idea how to perform it on someones else private Google Drive.

The first thing you need to understand is that drive api is a rest api the response is returned in Json format. The google drive api is not going to give you any visual representation of a users drive account. For example your not going to be able to show them the google drive web application from your website. You will need to code the interface yoruself.
As for how to get permission we use something called Oauth2 to request consent for your application to access the users google drive account. It can be a little confusing in the beginning but there are a number of tutorials and QuickStart's which should help you get started.

Related

How to correctly setup google drive API to access single google account's google drive?

I required to use google drive API to save and get image from company google drive.
I'm following this guide to get the token and currently successfully get the image via postman.
Because I'm using ./auth/drive scope, it required me to verify my application.
But I'll only use create and view api to access single google account. I'm not sure if I'm doing the things correctly.
It is possible to setup similar thing for one personal google account only so that it doesn't required to get the approval?

What drive does the Google Drive API connect to?

This might be a very silly question, but I'm just trying to make sure I'm going about things for my senior project right. Does the Google Drive API connect to the user's personal Drive space?
Actually it's a very good question because it confuses a lot of first time Drive users.
The answer is, It depends.
There are two distinct Google Drive APIs, with different characteristics and capabilities. These are the Google Drive REST API and the Google Drive Android API (GDAA). You have tagged your question with both.
The Google Drive REST API can connect to any Drive account, e.g. your own, one of your users, or a Service Account. Which account it connects to is determined by how the Access Token was generated.
The GDAA only connects to the Google account associated with the Android device it's running on.

How to integrate google-drive with google apps using APIā€¦?

i need to know how to open google drive files in google apps(like actual google drive file open) with API.Please give me an idea to implement this.
To integrate your application in Google Drive, first you need to enable the Drive API and provide configuration details in your API project and this part of documentation will explain you with that.
Then the Drive UI Integration part will contains fields to enter information describing your application. The Application Name and Short Description fields are displayed to users in the Manage apps dialog in the Drive UI
Go to Drive API, then after you enable, you can see the Drive UI Integration tab.
For the Opening of files, this link will help you on that. There is also a sample code here that will serve as a guide on you.

Google Drive API: Allows you to upload/download to users accounts or only your own?

I have a question about Google Drive that I'm hoping other programmers (with experience with the Google Drive API) will be able to answer. Note I have consulted the Google Drive API faqs and example projects but they dont answer my question. I'll provide some context in order for you to better understand my question.
We are developing an Smart Phone app that will allow people to view their civil engineering designs (Highway design, Dam design, Railway design, etc) in a 3d world, ie, showing their 'blue prints' in 3d. The app is being developed in Unity3d (3d Game Engine using C#).
Our plan is to create a Windows .exe (C# WinForms) that will allow the user to upload their blue print file to their own Google Drive account. The app will automatically download their blue prints from their google drive account (all the user has to do is login). Why create a .exe to upload files to a users account and not just get them to do it themselves through a web browser? Because we want to make it easy for the user, eventually provide automatic uploads/updates (when the user edits their project) and ensure that the files will always be in a specific folder on google drive. Thus a .exe will be able to achieve this.
My Question: Does the Google Drive API allow you to upload/download files to a users account. The Drive example projects appear to demonstrate uploading/downloading files to your own business Google Drive account and not a users. For those who have used the Google Drive API in their own projects; what are you charged for? Do you get charged for only downloading and uploading files or do you also get charge for connecting and querying files? If you upload/download files to an external Google Drive account (a users account) do you get charged or do they get charged?
If you have the users login to your app using Oauth2 they give you permission to access there google drive data. They can then download and upload to there account from your app.
Here are a few tutoials i did on this topic. Its a popular question, im working on a few sample apps to go with it.
Google Oauth2 c# Tutorial
Google Drive api C#
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets { ClientId = "YourClientId", ClientSecret = "YourClientSecret" },
new[] { DriveService.Scope.Drive,
DriveService.Scope.DriveFile },
"user",
CancellationToken.None,
new SavedDataStore(myStoredResponse)).Result; }

Understanding the authorization flow with Google Drive and Google Play Services

I have gone through Quickstart with Google Drive and I have also used Google Play Services. The docs for Google Drive outline the process of how the authorization flow works. The docs also indicate that developers should not use Drive initiated authorization although it appears that the Quickstart sample app does exactly that. I am left with the impression that Google prefers that the developer handle all the details of authorization.
Yet after trying out sample code that uses Google Play Services (but not for Google Drive), I am left with the impression that Google wants developers to use Google Play Services to handle all the authorization. It seems that Google Play Services simplify the authorization process significantly. Although the docs don't say this, I found elsewhere online that GoogleAuthUtil.getToken manages how access and refresh tokens are retrieved, especially after they expire.
Basically, the issue I am struggling with to understand is whether the Google Drive docs for the API are out of date and Google wants us to rely upon Google Play Services. There seems to be a lot of complexity in the Google Drive authorization process that Google Play Services has eliminated. At the same time, the docs for Google Drive API has been available for over half a year, so it makes me question why Google hasn't updated these docs to show any reflection on how Google Play Services are used with it.
Any insight into this would be appreciated.
The recommended approach for authorization on Android is using Google Play Services. The Android quickstart guide on the Google Drive SDK documentation covers exactly that:
https://developers.google.com/drive/quickstart-android
The Google Drive docs are out of date and Google should really update them. Retrieving tokens and authenticating users should be done using Google Play Services. The only thing you should be using the Google Drive API for is accessing the Google Drive service. Google Play Services handles all the details of authenticating users, retrieving access and refresh tokens and handling all the errors that can arise.