我試圖使用雲端硬盤API列出Google雲端硬盤中的所有文件。我找到了一個給我這個列表的API。驅動器API未運行?
當我嘗試在API瀏覽器中運行此API時,它工作正常。給我的所有文件 https://www.googleapis.com/drive/v3/files
但是,當我在&運行它證明API密鑰瀏覽器複製粘貼URL,告訴我一個錯誤的列表。
https://www.googleapis.com/drive/v3/files?key= {} YOUR_API_KEY
{
"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."
}
}
我在android系統相當新。我只想檢索文件列表。沒有搜索功能。
可能是那些文件沒有權限或者您的密鑰錯誤。 –
@RakeshChouhan如何解決此問題。我從2天開始嘗試。我創建了新的密鑰,但同樣的錯誤。 –
您需要使用包含授權和範圍的OAuth進程登錄。 API密鑰是不夠的。我已經在Javascript中完成了這項工作,但是由於您使用的是Android,請嘗試使用Drive [Android快速入門](https://developers.google.com/drive/v3/web/quickstart/android)。 – noogui