title: Gmail List API returning all messages when maxResults set to 100
body: <p>I am working on getting the Gmail List API setup, but for some reason, it returns all 5,000 messages in my inbox even though I have set maxResults to 100. Here is my current code:</p>
  
  <pre><code>$pageToken = NULL; 
  $messages = array();
  $opt_param = array();
  do {
      try {
          if ($pageToken) {
              $opt_param['pageToken'] = $pageToken;
              $opt_param['maxResults'] = 100;
              $opt_param['labelIds'] = 'INBOX';
          }
          $messagesResponse = $service-&gt;users_messages-&gt;listUsersMessages($userId, $opt_param);
          if ($messagesResponse-&gt;getMessages()) {
              $messages = array_merge($messages, $messagesResponse-&gt;getMessages());
              $pageToken = $messagesResponse-&gt;getNextPageToken();
          }
      } catch (Exception $e) {
          print 'An error occurred: ' . $e-&gt;getMessage();
      }
  } while ($pageToken);
  
  foreach ($messages as $message) {
      print 'Message with ID: ' . $message-&gt;getId() . '&lt;br/&gt;';
  }
  return $messages;
  </code></pre>
  
  <p>I'm not sure where I am going wrong, but I need to be able to filter down my inbox to the last 100 messages sent.</p>