Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List request page size being ignored

I've been working with the drive SDK for the last few days and previously I was able to request 1000 items on a page using listrequest. Now I'm only getting 100 files no matter how high I set the parameter, but if I set it below 100 it will return whatever number. Did they decide to change the max results overnight or something?

like image 350
Ben Ridley Avatar asked Dec 24 '22 20:12

Ben Ridley


2 Answers

I'm facing the same problem so I've been doing some tests and this is what I've found:

  • If I try files.list with fields: "files, nextPageToken", I get 100 files only.
  • If I try files.list with fields: "files(name, id, etc, parents), nextPageToken", I get 460 files.
  • If I try files.list with fields: "files(name, id, etc), nextPageToken" without parents field, I get 1000 files.
  • If I try files.list with fields: "files(parents), nextPageToken", I get 460 files.

So it seems that depends on how many fields you request and also if one of the fields requested is parents field.

like image 72
Ruben Lopez Avatar answered Dec 26 '22 08:12

Ruben Lopez


You've misunderstood what pagesize does. It is a maximum value, not an absolute value. You should always iterate list results until nextPageToken is null.

like image 23
pinoyyid Avatar answered Dec 26 '22 09:12

pinoyyid