pranahata
pranahata

Reputation: 540

Google Drive API ownership of files uploaded from service account

We are using a service account to upload files from a server and it has reached its storage quota limit. All files had been added under a folder created by another user (a @gmail.com account with 100 Gb storage quota) but all files uploaded are owned by the service account.

Note that we don't have real users, we are only using Google drive for storage purposes.

At the moment we are not able to upload any more files using the service account.

Is there a way to

Thanks

Upvotes: 6

Views: 3624

Answers (1)

Rivero
Rivero

Reputation: 914

To transfer the ownership of the file, you can rely on the "insert" method from the Permissions resource. You will need the fileId as a required parameter, and fill out the request body with the properties for: Role: [owner], Type: [user], and either one of these id:[userId within drive] or value:[email from the Drive account]. You can find more information in this link: https://developers.google.com/drive/v2/reference/permissions/insert

Upvotes: 2

Related Questions