【发布时间】:2016-02-20 08:55:14
【问题描述】:
如下图所示,Google drive API 已启用
当我运行我的代码时,我得到了一个错误提示:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Project has not enabled the API. Please use Google Developers Console to activate the API for your project.",
"reason" : "forbidden"
} ],
"message" : "Project has not enabled the API. Please use Google Developers Console to activate the API for your project.",
"status" : "PERMISSION_DENIED"
}
我使用了服务帐户方法,我也尝试了 OAuth2.0 客户端 ID,我得到了同样的错误。
启用驱动程序 api 有什么我错过的吗?
注意:
-
我正在尝试使用的范围 (DriveScopes.DRIVE "https://www.googleapis.com/auth/drive")
- 我在 Driver UI 集成中设置了所有需要的信息。
【问题讨论】:
标签: google-api google-cloud-platform service-accounts