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

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

问题描述

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

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. 使用源域服务帐户进行身份验证
  2. 与目标域中的用户共享文件
  3. 使用目标域服务帐户进行身份验证并模拟用户
  4. 将原始文件从源域复制到目标域
  5. 删除原文件的共享权限

一切都按预期进行,只是我不希望目标所有者收到通知他共享文件的 Google 云端硬盘电子邮件.当文件通过 Web GUI 共享时,可以禁用通知电子邮件,所以我想这也可以通过 API 实现,问题是如何^^ 任何人?

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:如果可能的话,我愿意接受新的不那么乏味"的方法来创建从一个域到另一个域的文件副本.

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.

推荐答案

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

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天全站免登陆