google-drive-api - 授予作者权限时如何防止 Google Drive API v3 发送通知电子邮件?
问题描述
我可以writer
使用 Google Drive API (v3) 授予权限。这是端点:
POST https://www.googleapis.com/drive/v3/files/FILE_ID/permissions"
API 参考说我应该使用sendNotificationEmail: false
(注意,这是一个布尔值而不是字符串),这就是我正在做的事情(在 v2 中,这被称为sendNotificationEmails
)。
但是,在通话后,我仍然收到来自 Google 的电子邮件,说我已被邀请编辑文件。
解决方案
sendNotificationEmail: false
按预期工作,有一个小细节:
它是一个超出资源主体的请求参数。
我不确定您使用的是哪种语言,例如 Javascript,请求将是:
gapi.client.drive.permissions.create({
"fileId": "XXX",
"sendNotificationEmail": false,
"resource": {
"role": "writer",
"type": "user",
"emailAddress": "test@gmail.com"
}
})
推荐阅读
- ios - 无法通过 recordName UUID 查询单个 CloudKit 记录
- python - 为什么 Xlim 和 Ylim 不能按预期工作
- regex - 为什么 grep 不匹配 "\<\-v\>"
- pipeline - 如何将本地目录挂载到大厅管道作业?
- bash - 如果 bash 命令接受文件名作为最后一个参数,是否可以使用管道提供文件内容?
- python - 多值赋值
- c# - 打开蓝牙设置页面并返回应用程序
- c# - 平面文件目标 预执行阶段失败。无法打开数据文件
- java - 我们可以使用带有破折号`-`或下划线`_`的spring-boot外部配置文件名吗?
- java - java.io.IOException:setDataSource 失败