且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Google Drive List API - 未列出所有文档?

更新时间:2022-10-31 13:33:56

可能结果列表仅限于100个项目。你可能想检查一下!
有一个选项可以增加这个限制:

$ p $ DocumentsListQuery dlq = new DocumentsListQuery(DocumentsListQuery.documentsBaseUri)
{
NumberToRetrieve = 100000,
ShowFolders = true,
Trashed = false
};


I am trying to list all the documents using Google Drive List API. But it doesn't list all the documents some documents details are not presented in the response.

This issue occurred in some of our customer's Drive account. When tried in OAuth2 playground, it results in the same response with missing documents list for these users.

Note : scope I used https://www.googleapis.com/auth/drive

File mimetype is "application/vnd.google-apps.spreadsheet"

Can anyone please help me to find out the reason for this ?

Probably the resultlist is limited to 100 items. You might want to check that! There's an option to increase this limit:

            DocumentsListQuery dlq = new DocumentsListQuery(DocumentsListQuery.documentsBaseUri) 
            { 
                NumberToRetrieve = 100000,
                ShowFolders = true,
                Trashed = false
            };