[英]Why using Google Cloud Drive Rest API file.list can not get all the files?
I am using the following CURL command to retrieve all my google drive files, however, it only list a very limited part of the whole bunch of files.我正在使用以下 CURL 命令来检索我所有的谷歌驱动器文件,但是,它只列出了所有文件中非常有限的一部分。 Why?
为什么?
curl -H "Authorization: Bearer ya29.hereshouldbethemaskedaccesstokenvalue" https://www.googleapis.com/drive/v3/files
result结果
{
"kind": "drive#fileList",
"incompleteSearch": false,
"files": [
{
"kind": "drive#file",
id": "2fileidxxxxxxxx",
"name": "testnum",
"mimeType": "application/vnd.google-apps.folder"
},
{
"kind": "drive#file",
"id": "1fileidxxxxxxx",
"name": "test2.txt",
...
}
token scope includes https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.appdata令牌 scope 包括https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.appdata
Using the Android SDK also facing the same issue.使用Android SDK也面临同样的问题。
Any help would be appreciated.任何帮助,将不胜感激。
Results from files.list are paginated -- your response should include a "nextPageToken" field, and you'll have to make another call for the next page of results. 来自files.list的结果是分页的-您的响应应包含“ nextPageToken”字段,并且您将不得不再次致电下一页结果。 See documentation here about the files list call.
请参阅此处有关文件列表调用的文档。 You may want to use one of the client libraries to make this call (see the examples at the bottom of the page)
您可能想使用其中一个客户端库进行此调用(请参阅页面底部的示例)
I have the same problem when try to get list of files in Google Drive folder.尝试获取 Google 云端硬盘文件夹中的文件列表时,我遇到了同样的问题。 This folder has more than 5000 files, but API return only two of them.
这个文件夹有5000多个文件,但是API只返回其中两个。 The problem is -- when files in folder shared with anyone with a link, in fact it isn't shared with you until you open it.
问题是——当文件夹中的文件通过链接与任何人共享时,实际上只有在您打开它后才会与您共享。 Owner of this folder must specify you as viewer.
此文件夹的所有者必须将您指定为查看者。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.