必须提供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 (将#修改为@)