I have uploaded a file to a service account and I'd like to transfewr its ownership to a normal Drive account.
Here is what I'm currently doing:
service = build('drive', 'v3', http=http)
service.permissions().create(
fileId='0B4Z29qk96f_ac3RhcnRlcl9maWxl',
transferOwnership=True,
body={
'type': 'user',
'role':'owner',
'emailAddress':'new-user@gmail.com'
).execute()
Yet When I try and do this, I always get the following error:
googleapiclient.errors.HttpError: https://www.googleapis.com/drive/v3/files/0B4Z29qk96f_ac3RhcnRlcl9maWxl/permissions?alt=json&transferOwnership=true returned "Bad Request. User message: "You can't yet change the owner of this item. (We're working on it.)""
is there a way to transfer the ownership of a service account Drive file to a normal Google Drive user? If so, how?
API Reference: https://developers.google.com/drive/api/v3/reference/permissions/create.
Note: if I use the 'writer' role it will work, but I need to create a new Owner and transfer the file.