尝试通过 Google 云端硬盘的 API V3 添加文件权限,但遇到了以下错误。我希望允许来 self 的网站 mta.io 的请求能够读取该文件。该错误似乎来 self 在请求正文中传递的域,例如 example.com 工作正常并且已授予它权限。我是否需要将我的域列入白名单才能授予其文件权限?
作品:
{
"role": "reader",
"type": "domain",
"domain": "example.com"
}
不起作用:
{
"role": "reader",
"type": "domain",
"domain": "mta.io"
}
错误:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "The specified domain is invalid or not applicable for the given permission type.",
"locationType": "other",
"location": "permission.domain"
}
],
"code": 400,
"message": "The specified domain is invalid or not applicable for the given permission type."
}
}
我正在使用try it在 API 网站上找到的功能。
最佳答案
明白了,您只能使用 G Suite 域。 这很糟糕,但为了与某个域独家共享文件权限,您需要拥有一个 G Suite 帐户并验证您是否拥有该域 - 该域需要与您的 G Suite 帐户链接。
https://developers.google.com/drive/v3/web/about-permissions#types_and_values
For example, a permission with a type of domain may have a domain of thecompany.com, indicating that the permission grants the given role to all users in the G Suite domain thecompany.com
关于javascript - 谷歌云端硬盘 API V3 : Creating file permissions for a domain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43314298/