F. Vosnim
F. Vosnim

Reputation: 574

Write to Google Drive using Service Account Credential on behalf of different owner in Python

When I create a file

drive_api = build('drive', 'v3', credentials=credentials)
ss_drive = drive_api.files().create(body=file_metadata).execute()

I'd like to write it on behalf of different owner. Or change the owner afterwards.

​'owners': [{'displayName': '1@',
  'emailAddress': '1@',
  'kind': 'drive#user',
  'me': True,
  'permissionId': '1'}],

Is it possible?

Upvotes: 0

Views: 185

Answers (1)

ZektorH
ZektorH

Reputation: 2770

For the sake of documentation.

  1. You can create files as other users with Domain Wide Delegation.

    • This requires a G Suite Domain
    • This is also overkill, since Domain Wide Delegation is a lot of permissions
  2. You can create the files normally then update the permissions to have another user as the OWNER.

Upvotes: 1

Related Questions