google drive api无法加载文件夹的子项

时间:2017-05-12 13:33:27

标签: google-app-engine google-drive-api google-drive-android-api

在google drive api中,我试图通过提供folderId来检索文件夹的子项。我收到错误

Cannot read property 'list' of undefined

因为未在下面的行中定义子项

gapi.client.drive.children.list

我提供了试试例here

中提到的所有范围

这可能是因为我发现了我的文件:var DISCOVERY_DOCS = [“https://www.googleapis.com/discovery/v1/apis/drive/v3/rest”];

我还尝试使用获取以下网址并获取401

https://www.googleapis.com/drive/v2/files/'+ folderId +'/children;

知道这个问题可能是什么原因。如果我应该提供更多信息,请告诉我。

1 个答案:

答案 0 :(得分:2)

gapi.client.drive.children.list是v2端点。你正在使用v3。等效于files.list,父母中有q={folder_id}。列出了更多v3等效项here