Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clarification on maxResults and nextPageToken using Google Drive API v2

I just wanted clarification with regard to the Files: list feature of the Google Drive API here:

https://developers.google.com/drive/v2/reference/files/list

What is the the maximum value that can be specified with maxResults? I assume this value calculates the number of results on the next page of results?

Also, is the nextPageToken simply part of the query string that's required to be passed with nextLink to get the next page of results?

Thanks!

like image 539
Stuart Memo Avatar asked Jul 30 '12 22:07

Stuart Memo


Video Answer


2 Answers

The maxResults query parameter can be used to limit (or increase) the number of items returned in a list request. There is a default value and a hard limit that is set by our server. Unfortunately, we don't usually document those numbers as they can easily change and recommend developers to look for a nextPageToken and/or nextLink in the resulting collection to know whether or not all items have been returned.

The nextPageToken attribute is to be used as the pageToken query parameter on a list request. If you are using the nextLink from the resulting collection, you do not need to specify the pageToken query parameter as it should already be included.

like image 167
Alain Avatar answered Sep 28 '22 13:09

Alain


maxResults cannot be larger than 1000 according to this page: https://developers.google.com/drive/v2/reference/files/list

like image 27
lindenrovio Avatar answered Sep 28 '22 13:09

lindenrovio