【问题标题】:Google Drive API - insufficientFilePermissions error when downloading a fileGoogle Drive API - 下载文件时出现“文件权限不足”错误
【发布时间】:2021-03-23 08:58:18
【问题描述】:

我正在开发一个使用 google drive api 下载文件的项目。我正在使用具有所有驱动器权限的服务帐户 (https://www.googleapis.com/auth/drive)。

我可以毫无问题地下载一些文件,但有时我会收到以下错误:

{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "insufficientFilePermissions",
                "message": "The user does not have sufficient permissions for this file."
            }
        ],
        "code": 403,
        "message": "The user does not have sufficient permissions for this file."
    }
}

当我尝试下载文件时,我会冒充文件的所有者。该文件的所有者肯定可以访问该文件,所以我不确定为什么会出现此错误。

有人能解释我怎么可能会得到这个错误吗?

【问题讨论】:

  • 你能显示你的模拟代码吗?听起来它模拟不正确。

标签: google-api google-drive-api google-admin-sdk


【解决方案1】:

问题是我试图模拟的用户已被暂停。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-08-04
    • 2018-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多