I am creating one application when users can use his/her drive account to save documents. Can i use Drive API so the users save documents in drive? The users will use my app to upload pdf documents in his/her folder.
Yes you can use the Google Drive api to create, update and delete files on a users google drive account.
You Will need to use Oauth2 to have the user authenticate your application granting it access to their google drive account.
You should be aware that the Google drive api has a number of sensitive and restricted scopes which will make the verification process a little more complicated than it would be otherwise.
What you need to know about Google verification in 2021.
Related
Is it possible give a Google App Script permission to create files in a user's Google Drive, and then only have edit/delete access to those files, without having write access to any other files?
From what I can understand, the permission I need for this is drive.file under dependencies.enabledAdvancedServices[].serviceId, which is available in Google Drive API v3, but Google App Scripts only supports v2 (at least, as far as I can tell in the "Advanced Google Services" dialog).
Is there a way to get drive.file in GAS that I'm missing? Or has Google announced any plans to bring v3 into GAS? Or another way to restrict my script to only having write access on files it creates?
I have a web app created using google script which is distributed in a team,They will use it to upload some files.
I want to save those files into my drive rather than their own accounts.
According to my research I can only save it my account If I publish that app with option Execute as me and option who has access with anonymous.
But I want to Execute as user accessing this app option(that required user to authorized).
Anyone know how to solve this?
Create a service account and enable Domain-wide Delegation of Authority on it. Then you can execute saves to the Google Drive under your account. You'll need to leverage a Google OAuth2 library.
Here's a good one:
OAuth2 for Apps Script
Hi Google Drive SDK team on Stackoverflow. I need a personal reply from you guys as this question is important for the backend architecture of a cloud application we are working on.
We want to integrate Google Spreadsheet in the frontend of a cloud application, but we want to structure the backend in such a way that all
user application data/files is stored only on one main Google Drive and not in the user's Google Drive. Does the Google Drive SDK or other Google
products enable the capabilityneed? From the Google Drive SDK page the typical use case is that an app stores data in the user's own Google Drive account.
Our case is different and we want to store all data in our own Google Drive account. Looking forward to your reply. Thanks
https://developers.google.com/drive/v2/reference/files/copy#examples
Its possible but you need to read more about how oauth works and spreadsheet permissions (btw im not from the drive team).
If you will use the users tokens your only option would be to have a backend create the spreadsheet on your drive (with you as the owner) and share it with the user.
If you will use your own tokens and not the user's, you will need a backend to serve as proxy for spreadsheet operations. That way you dont give write permission to the user (so she cant change your data). Drawback of using your own tokens is that you will have quota issues with many users.
The first thing you need to do is decide which API you intend to use.
The link you posted is for the Drive API. This will allow you to upload and download spreadsheets, but not manipulate their contents.
If you require row or cell level access to a spreadsheet, that will use the Spreadsheets API. See https://developers.google.com/google-apps/spreadsheets/
Next decide how you will deal with permissions. You want a centrally owned spreadsheet, so you have three choices.
Proxy all of the access through a web server as suggested by #zig
Access the spreadsheet directly, but use a centrally provided access token
Use a Service Account
I'm working on an intranet Google Drive app. Users will authorize it with their corporate Google Apps account.
Everything works well, but, users that are using Google multiple sign in cannot download files using the "export URL" (https://drive.google.com/uc?export=download&id=FILE_ID), because Google Drive assumes they are using their private/default Google account instead of the corporate account. And the private account is not authorized to access the files.
I guess they can still access the files through the Google Drive interface by manually switching to the correct account, but I need to provide direct access.
Is there anything I can do?
I'm receiving this error when trying to change file ownership from Google Apps Script (Google Apps for Education):
GDataServiceExceptionYou can't yet change the owner of this item. (We're working on it.)
The same code works on a Google Apps for Business domain. Is there a limitation for EDU domains?
Ok, found the answer in the Google Drive support pages:
Only Google Apps customers in Premier and Government domains can
transfer ownership of a synced or uploaded file (such as a PDF or
image file). If you're using Google Drive and Google Docs with a
personal account or with a Google Apps for Education account, you
can't transfer ownership of a synced or uploaded file.
http://support.google.com/drive/bin/answer.py?hl=en&answer=2494892
Does anyone know why this limitation exists for Education accounts?
Is Google really working on it (as mentioned in the error message)?