2017-07-04 125 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您必須啓用安全的範圍 - 高級配置