title: GmailAPI: How can I get the next page of results for a certain query?
body: <p>I have a certain query that I am using to get results that correspond to a particular search:</p>
  
  <p>response = gmail_service.users().messages().list(userId=user_id, q='from:"digital-no-reply@amazon.com"', pageToken='').execute()</p>
  
  <p>To get the next page of results, is this the right query:</p>
  
  <p>response = gmail_service.users().messages().list(userId=user_id, q='from:"digital-no-reply@amazon.com"', pageToken=next_page_token).execute()</p>
  
  <p>I tried not giving the query param, thinking that the next_page_token should contain a reference to the query that generated the previous page, but the results I got did not come from the query parameter. Hence wondering what is the correct way of getting all pages of results corresponding to the query?</p>