2017-07-04 129 views
0

我正在学习如何使用谷歌云端硬盘API上传文件,我得到这个错误:获得401未授权错误的谷歌API

"Client error: `POST https://www.googleapis.com/oauth2/v4/token` resulted in a `401 Unauthorized` response:\n{\n \"error\": \"unauthorized_client\",\n \"error_description\": \"Client is unauthorized to retrieve access tokens using this me (truncated...)\n" 

我想从我的服务帐户的配置错误这干。在创建我的服务帐户时,我没有使用启用G Suite域范围委派并仅使用生成的json密钥。

以下附件是我的IAM & ADMIN enter image description here

我也为谷歌驱动器启用API,所以我缺少什么的截图?

非常感谢您

回答

1

你必须创建一个客户端ID为服务帐户,并使用该ID您必须启用安全的范围 - 高级配置