title: Using Gmail API search parameters
body: <p>I am using the gmail API to search for messages. I want to include a few search parameters, but I can't figure out how to use more than one search parameter. I'd like to do older_than and -unsubscribe</p>
  
  <pre><code>$(document).ready(function() {
      var submitButton = 0;
  
    function randomPicture (){
      min = Math.ceil(1);
      max = Math.floor(14);
      var pictureNumber = Math.floor(Math.random() * (max - min)) + min;
      $('.sidetext').css('background-image', 'url(images/pic'+pictureNumber+'.jpg)');
      console.log(pictureNumber);
    }
  
      $('#submit').click(function(){
        randomPicture();
        var searchTerm = $('#input-person').val();
        listMessages('me', searchTerm, listMessageCallback);
         submitButton = submitButton + 1;
       $('.quote').remove();  
  
      });
  
      function listMessages(userId, query, callback) {
        $('#content').css('left', $('sidetext'.offsetLeft));
        var getPageOfMessages = function(request, result) {
            request.execute(function(resp) {
              result = result.concat(resp.messages)
          };
  
        var initialRequest = gapi.client.gmail.users.messages.list({
          'userId': userId,
          'q': query
        });
  
        // var Request = gapi.client.gmail.users.messages.list({
        //     'q': 'older_than:1y'
        // });
  
        getPageOfMessages(initialRequest,[]);
      }
  
      function listMessageCallback(result){
        console.log(result[0].id);
        var messageId = result[0].id;
        getMessage('me', messageId, getMessageCallback)
  
      }
  
      function getMessageCallback(result){
        console.log(result)
        $('#content').html(result.snippet);
        $('#content').css('font-size', '20px');
        $('#content').css('bottom-margin', '0');
        // $('#content').app
      }
  
      function getMessage(userId, messageId, callback) {
        var request = gapi.client.gmail.users.messages.get({
          'userId': userId,
          'id': messageId,
          'nonce': Math.random()
        });
        request.execute(callback);
      }
  
  
    })
  </code></pre>