Sharing a Google Drive file without sending notification email

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 06:01:15

问题


I am using Google Drive Java API. I need to copy a file from one Google domain to another, so my approach is the following:

  1. authenticate with source domain service account
  2. share file with user in destination domain
  3. authenticate with destination domain service account and impersonate the user
  4. copy the original file from origin domain to destination domain
  5. delete the share permission from the original file

Everything works as expected except that I don't want the destination owner to receive the Google Drive email notifying him about the shared file. When the file is shared via the Web GUI one can disable the notification email so I guess this is also possible via the API, the question is how ^^ Anyone?

PS: I am open to new 'less tedious' methods to create a copy of a file from one domain to another if that is possible.


回答1:


On step 2, when sharing the file with the new user, you'll be using the permissions.insert() API call. You'll want to specify the sendNotificationEmails=false parameter along with this call to suppress the email notification.



来源:https://stackoverflow.com/questions/22071187/sharing-a-google-drive-file-without-sending-notification-email

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!