Google Drive API 403禁止 [英] Google Drive API 403 Forbidden

查看:493
本文介绍了Google Drive API 403禁止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用Google驱动器API来允许我们的用户浏览并选择要在报告中使用的文件。我们的一个用户(这个问题并不普遍)在尝试获取文件列表时收到错误(下文)。



从Google返回的JSON正文:

p>

  {
错误:{
错误:[
{
域名:全球,
原因:禁止,
消息:禁止
}
],
代码: 403,
message:Forbidden
}
}

这有点令人困惑,因为它不是列在这里的错误之一: https:/ /developers.google.com/drive/web/handle-errors



有人对此有何看法?感谢您的任何见解!

解决方案

原来与此问题有关:获取403 - Forbidden for Google服务帐户



<该用户的公司没有将Google云端硬盘作为其激活的应用之一。


We are using the Google drive API to allow our users to browse and select a file to use in a report. One of our users (the issue is not widespread) is getting an error(below) when attempting to get a list of files.

JSON body returned from Google:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "forbidden",
    "message": "Forbidden"
   }
  ],
  "code": 403,
  "message": "Forbidden"
 }
}

Which is a bit confusing as it is not one of the listed errors here: https://developers.google.com/drive/web/handle-errors

Does anyone have any ideas on what might be causing this? Thanks for any insight!

解决方案

It turned out to be related to this question: Getting a 403 - Forbidden for Google Service Account

This user's company did not have Google Drive as one of their activated apps.

这篇关于Google Drive API 403禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆