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

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?

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.

Google Drive API grant access to another/multiple Apps

Currently, we have a mobile App that is storing data into a Google Drive folder using the scope
https://www.googleapis.com/auth/drive.file
View and manage Google Drive files and folders that you have opened or created with this app
Now we are planning to add a web app as well. The problem is, that the web app cannot access files uploaded by the mobile app and vice versa.
So is there a way to tell the Google Drive API that those two apps (web app and the mobile app) are in fact the 'same' application?
I want to avoid using the scope for full access to the user's Google Drive.
https://www.googleapis.com/auth/drive
Or is there another way that both apps can read/write the same folder?
Thanks in advance.
I also took a look at the Google Picker API but it does not seem to be what I want.
Posting this for documentation purposes.
As mentioned in comments, both apps should be part of the same Google Cloud Platform project, that's the only way to "tell" the API that they are the same application.
If they are not part of the same project, you should use the drive scope instead.

how to get profile information for users using google drive api

I'm trying to migrate from the Documents List API to Drive API.
My application using "getting profile information for users" function, but Google Drive API has no that function.
So, I have a problem to migrate from the Documents List API.
Please let'me know how to solve it.
See:
https://developers.google.com/accounts/docs/OAuth2Login#userinfocall
for updated information on retrieving user profile information.

Authentification to Google Drive API with OAuth from Google Apps For Business possible?

I use Google Apps For Business to manage 14 accounts for a domain.
There is the possibility to set a OAuth key and secret for the domain. With this credentials you can access all files from each account without knowing their personal password or oauth credentials.
With the Google Documents List API it was easy to write a small script so that i could back up the data.
Is it possible to back up these files with the new Google Drive Api without knowing each OAuth2 credential?
there is a notion of Service Accounts by which you can reach what you want, have a look at google's docs on this https://developers.google.com/drive/delegation

Access to all files on a user's Google Drive

The api's for SkyDrive and Dropbox have options for managing the user's entire drive. For Google Drive, the drive.file scope seems to give only access to the files created by the app.
Is there a scope for Google Drive that gives access to the entire drive?
Edit: The below answer was correct, but the latest version of the Drive API allows requesting of a full scope with https://www.googleapis.com/auth/drive. The Documents List API is no longer needed for this use case. See https://developers.google.com/drive/scopes#requesting_full_drive_scope_for_an_app
To be precise the Drive API gives access to Files created by the app and files that the user has opened with the app from the Drive UI (through open-with).
To manipulate all of the Drive files of the user you can use the Google Document List API . Though we currently forbid Drive applications (the ones that have get integrated in the Drive UI through the Open-with and Create dialogs) to request access to the Document List API as we want to keep Drive application on a per-file security model. (Basically adding the Document List scope in the Drive SDK settings raises an error).