简体   繁体   English

为什么用Google Cloud Drive Rest API file.list 获取不到所有文件?

[英]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.

相关问题 如何使用Java Drive Rest V2 API从Google Drive获取文档和文件的绝对路径? - How to get absolute path of a document and file from Google Drive Using Java Drive Rest V2 API? 如何使用 Google Drive API 获取特定文件夹中所有文件的列表 - How to use Google Drive API to get list of all files in specific folder 使用 REST API 从 URL 上传文件到 Google Drive - Upload file to Google Drive from URL using REST API 如何使用REST API将新修订版本上传到Google云端硬盘中的特定文件? - How can I upload a new revision to an specific file in Google Drive using the REST API? Google Drive Rest Api 文件导出限制 - Google Drive Rest Api Files export limitation 使用Google Drive Rest API上传文件 - Upload a file with google drive rest api 使用 curl 命令通过 drive-rest-api 将文件上传到谷歌驱动器中特定文件夹的直接方法 - Direct way to upload a file to specific folder in google drive through drive-rest-api using curl command 我们可以使用rest api获取SharePoint列表中的所有私有视图吗 - Can we get all of the private views in a SharePoint list using rest api 使用Rest API / C ++从Google Drive下载文件 - Downloading files from google drive with rest API / c++ 使用Google云端硬盘REST API V3观看文件时,通知不一致 - Inconsistent notifications watching files with Google Drive REST API V3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM