Approve request for drive file access programmatically - google-api

I have a requirement where a user having read access to a file (google native docs) can access for edit access to the drive file (from google drive UI) since the owner of the file would always be known to us (A account not operated by human). Do we have any API in google drive or g suite admin where we can fetch the pending requests for granting access to a given file?

Related

About using google drive api to one application that allow all registered user in drive to save a document

I am designing one application that use google API so all users can save file in their account. My question is, how i have to manage API Key in that scenario?
Example:
Suppose user Peter has a google drive account, then he login in my app and save the file, the same for all users that loggin in my app.
Best regards.

Sharing folder with external visitors via Google Drive API

Any ideas on how to share a Google drive folder with an external visitor that does not have a Gmail address?
When creating link(Using UI) for external visitor(not a gmail or gdrive user) we get an option to notify user with a link(This is not the same link as share link).
The notification email contains a link where user visits and enters an
OTP to login which is emailed to external user by Google.
I need the external user to have writer access too. I can see here that it is possible via the UI however I cannot find any reference to this in the API documentation. I have successfully generated a share link using this documentation, but Google is requiring the user to log in, which is not what I want.

Can I backup user data according to Google Drive API Terms of Service?

ToS states - https://developers.google.com/drive/api/v3/terms:
"The Drive API is not allowed for certain use cases without Google’s express prior written consent, including the following:
Backup of user/app content from developer’s app to Drive."
While on Introduction to Google Drive API we read - https://developers.google.com/drive/api/v3/about-sdk:
"You can use Google Drive API to:
Create a dedicated Drive folder to store your application’s data so that the app cannot access all the user's content stored in Google Drive. See Store application-specific data."
So can I use it to store user data, which it generates while using the app and autosync it like Viber does? It could be .json files, maybe photos.
The application data folder is a special hidden folder that your app can use to store application-specific data, such as configuration files. The application data folder is automatically created when you attempt to create a file in it. Use this folder to store any files that the user shouldn't directly interact with. This folder is only accessible by your application and its contents are hidden from the user and from other Drive apps.
There's a big difference between user/app content from developer’s app and configuration file.

Google Api Service Account authentication access to developers data

I want to develop an application that uses the Picasa Google API for uploading images to my own account. I've already created the Service Account from the API Console and have created the code to upload the image (which works correctly given a valid access_token obtained from the OAuth2 playground).
However, when trying to obtain an access_token with the Google-api php library, this one doesn't seem to be associated to my own username (obviously, no consent screen), which throws me a 404 Not found error message when trying to access data from my personal account.
From what I've read over at https://developers.google.com/api-client-library/php/auth/service-accounts I could create an apps account to setup permissions for a whole domain. Is this, however, necessary given that I only want to access information from my own account? (the same I used to register the application in the API console). Couldn't this be done beforehand using API panel?
A service account is not you and does not by default have access to any data. Think of a service account as a dummy user. If you take the service account email address and add it as a user on a folder in your google drive it will have access to that folder on google drive. If you take the service account email address and give it access to one of your calendars on Google Calendar it will have access to the calendar.
If you set the album public I suspect it will then have access to the album. I did some Googleing and I cant see how you can add another users email address to an album on picasa.
I suggest you try using Oauth2.

Uploading a new file revision using Google Drive Api

I am trying to upload a multi-part document using the Google Drive Api. (Specifically - PUT https://www.googleapis.com/drive/v2/files/{fileId} )
My environment has two super-admins (User A and B) (for whatever reason).
The Api is authenticated using one of the 'super-admin' (User A).
When I try to upload a revision for User A, then it succeeds.
However, when I try to upload it for User B, I get
'The authenticated user does not have the required access to the file {fileId}'.
I would imagine the super admin to have access to everything.
Does it entail to the scope I am using ? ( This is my current scope of request - https://www.googleapis.com/auth/drive)
Can someone tell me what am I missing ? :-/
Thanks.
Even super admins do not have access to a file unless they've been directly granted access to that file. You can:
Have User A share the file with User B (writer access). Then User B can update the file.
Authenticate as User A in order to perform the update.
Use a Service Account to authenticate and act as any user in the domain.

Resources