将Google云端硬盘文件访问权限设置为“具有访问链接的任何人”,将得到403。如何解决?

时间:2018-09-06 03:37:27

标签: google-api google-drive-api

发出API请求
making the api request

403响应
403 response

我想以编程方式为我的google驱动器文件设置权限,就像有人拥有google驱动器可共享链接,以便他可以阅读一样。将role设置为reader,将type设置为anyone之后,尝试使用api给了我403。任何帮助,将不胜感激。请参考上面的图片。

这是我的HTTP GET响应的一部分

    "userPermission":{  
      "kind":"drive#permission",
      "etag":"\"v8V6DvTBE_bfiGlEO9jLLdDEcEE/vrb4MS7MSuazJcKlWO78yMuKxF0\"",
      "id":"me",
      "selfLink":"https://www.googleapis.com/drive/v2/files/1Vnp6v2VSE3sHKb9H9ChJPc8VPozuVtyd/permissions/me",
      "role":"owner",
      "type":"user"
   },
   "originalFilename":"1200px-Arriva_T6_nearside.JPG",
   "fileExtension":"JPG",
   "md5Checksum":"52f04535ea275c8be7ad87853a49fb87",
   "fileSize":"343589",
   "quotaBytesUsed":"343589",
   "ownerNames":[  
      "Dev Drive"
   ],
   "owners":[  
      {  
         "kind":"drive#user",
         "displayName":"Dev Drive",
         "isAuthenticatedUser":true,
         "permissionId":"00918695921514386946",
         "emailAddress":"devdrive@finetechlk.net"
      }
   ],

0 个答案:

没有答案