在不发送通知邮件的情况下共享Google Drive文件 [英] Sharing a Google Drive file without sending notification email

查看:574
本文介绍了在不发送通知邮件的情况下共享Google Drive文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google Drive Java API。我需要将文件从一个Google域复制到另一个域,因此我的方法如下:
$ b


  1. 使用源域服务帐户进行身份验证 li>
  2. 与目标域中的用户共享文件

  3. 使用目标域服务帐户进行身份验证并模拟
    用户

  4. 将原始文件从原始域复制到目标域

  5. 从原始文件删除共享权限

除了我不希望目的地所有者收到通知他关于共享文件的Google Drive电子邮件之外,一切都按预期工作。当文件通过Web GUI共享时,可以禁用通知邮件,所以我猜这也可以通过API,问题是如何^^任何人?



PS :如果可能的话,我愿意创建一个从一个域到另一个域的文件副本的新较少繁琐的方法。 解决方案

在第2步中,与新用户分享文件时,您将使用 permissions.insert() API调用。您需要在此调用中指定 sendNotificationEmails = false 参数来抑制电子邮件通知。


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.

解决方案

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.

这篇关于在不发送通知邮件的情况下共享Google Drive文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆