Understanding the authorization flow with Google Drive and Google Play Services - google-drive-api

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.

Related

Google Drive integration with private website

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.

Files on Google Drive giving API error. Need “Drive Realtime API data” associated with the old file

I am regular user of Mindmup on google drive , a top rated mind mapping tool on Google drive marketplace.
I have an 2016 Mindmup which I am not able to open. Mindmup said they can help if google can provide “Drive Realtime API data” associated with the old file.
Google has a note that claims that read only access should continue, which is not true. And the link to how to "export realtime API data" is broken.
Answer:
Unfortunately, as the Google Realtime API has been deprecated, this isn't something the Stack Overflow community can help with.
What You Can Do:
From here, your best bet is to contact Google directly and see if they can provide you with the respective API data that you need. There is still a cached version of the API reference on Google Search which you can access, which may have links to the correct pages you are looking for.
Google Support can be contacted here, though I feel for this it may be more helpful for you to contact G Suite Support directly. You'll need to follow the corresponding link to you account on this page and contact them this way.
References:
Cache of Google Realtime API Reference
Google Help
Contact G Suite Support

Is there any API to get metadata schema for Google Drive rest API

On Google Drive documentation I could see schema for individual resources like File,Permissions etc but no where mentioned about API for meat data of all resources.
The Discovery Service API is an interesting if little known API it gives you all the information you could ever need about Google APIs.
If you take the following command and place it in a web browser you will see everything you could ever want to know about the Google Drive API v3.
https://www.googleapis.com/discovery/v1/apis/drive/v3/rest

Should I list my new app on the google apps marketplace, or is the chrome web store enough?

I want to list a new application that will integrate with the Drive UI. Should I list it on the Google Apps Marketplace?
This seems like an obvious "yes," but the documentation seems to say that I only need to upload a manifest file to the Chrome Web Store.
I've been very confused by seemingly contradictory docs and links across different brands, versions of documentation, etc. If anyone can share a succinct list of steps to making my app available to install on a Google Apps domain, I'd appreciate any tips!
You should list your Drive App on the Google Apps marketplace if you want Google Apps Customers use your app. You can list your apps for either Enterprise users or Consumers (gmail and the like) but not both. To list your Drive App in the Marketplace, make sure you specify "container": ["DOMAIN_INSTALLABLE", "GOOGLE_DRIVE"] in your manifest. Note that you should not specify the app member in the manifest as that would make it a consumer app and is not compatible with the Google Apps Marketplace.
We're constantly working to improve our documentation but your feedback is noted.

How can I build a Desktop client for Google Drive?

I want to build desktop application for Windows OS and use Google Drive to save some data in the cloud. After reading Google Drive SDK I found that only Web-applications, were installed from Chrome Web Store are allowed to use API and have access to data on Google Drive.
So my question: do I have any way to build native client (C++, Windows) for Google Drive? I know about hacks with using Google Docs API - but they can stop working any time, and I want something stable. Why Google team do not allow me create desktop application for their service? I have support of many other cloud storages and they do not have such restrictions.
Thanks.
For now you will have to use the (older) Google Document List API which provides full read-write and list access to Google Drive. (Google Drive and the former Google Docs use the same data)
So until we extend the capabilities of the current Drive API to cover the Google Document List use case you should use that instead.
EDIT: We just launched the v2 of the Google Drive SDK so you should now use that instead.
I have been working on a similar problem. I have realized that there is no straight forward way for doing this. Google Drive SDK is not easy to work with and how someone can simplify the process of connecting desktop application to Google drive shortly. I know this is not much help, but I am looking for a soltuion as well.
Here is some links that I have come across, haven't solved my problem either, but if you come to a solution please let us know PLEASE:
How to make GUI Client to upload file in java
Using Java APIs for downloading file from the Google Drive
http://www.coderanch.com/t/643120/Servlets/java/upload-file-drop-box-file