I am trying to get all the inbox messages in the Gmail API, but it's limiting to 500 per request. I would like to get all the messages, and the current messages in the repository is 1600+ but I am only able to get 500 on one request.
$service = new Google_Service_Gmail($client);
$user = 'me';
$params = array(
'labelIds' => 'INBOX',
'maxResults' => 20000
);
$last_date = mysqli_fetch_array($query);
extract($last_date);
$date = date_create($latest);
$date->modify('-1 day');
$filter_date = date_format($date, 'Y/m/d');
$params['q'] = 'in:inbox after:'.$filter_date ;
$messages = $service->users_messages->listUsersMessages( $user, $params );
$list = $messages->getMessages();
//$list only has 500 messages returned to me.