如何解决必须提供Google云端硬盘api权限值字段
我正在编写一个角度代码,以授予另一个帐户访问Google驱动器中特定文件的权限。
public async givepremission(fileid,email){
await gapi.client.setApiKey(this.credconst.APIkey.toString());
return await gapi.client.load("drive","v3")
.then(async () =>
{
return await gapi.client.drive.permissions.create({
"fileId": fileid,"resource": {
"role": "reader","type": "user","emailAddress": email
}
}) },(err) => {
this.toastr.error('Google API error');
throw(err);
});
}
但是我得到的只是一个错误
domain: "global"
reason: "required"
message: "Permission value field required"
locationType: "other"
location: "permission.value"
我在https://developers.google.com/drive/api/v3/reference/permissions/create 尝试此API 中进行了尝试,在这里工作正常,但在我的项目中抛出了以上错误。
我用来授予权限的帐户不是G-Suite用户。
我不知道为什么会出现此错误?
我该如何解决这个问题?
-谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。