title: How to retrieve result for Google QPX with Javascript/jQuery (Ajax)?
body: <p>I have already signed up for Google API Console and set up the account and API key, but my question is how do I retrieve the results from Google QPX. <strong>What causes the error below?</strong></p>
  
  <p><strong>Setting up the json Query for Google Request</strong></p>
  
  <pre><code>var FlightRequest = {
    "request": {
      "slice": [
        {
          "origin": "DCA",
          "destination": "LAX",
          "date": "2015-02-11"
        }
      ],
      "passengers": {
        "adultCount": 1,
        "infantInLapCount": 0,
        "infantInSeatCount": 0,
        "childCount": 0,
        "seniorCount": 0
      },
      "solutions": 20,
      "refundable": false
    }
  }
  </code></pre>
  
  <p><strong>Requesting the Data and Returning it.</strong></p>
  
  <pre><code>$.ajax({
   url: "https://www.googleapis.com/qpxExpress/v1/trips/search?key=XXXXXXXXXXXXXXXX", 
   type: 'POST',
   dataType: 'json',
   contentType: 'application/json',
   data: FlightRequest,
   success: function (data) {
    alert(JSON.stringify(data));
  },
    error: function(){
     alert("Cannot get data");
   }
  });
  </code></pre>
  
  <p><strong>Error:</strong>
  I have already checked my API Key and is Correct. What can cause this issue?</p>
  
  <blockquote>
    <p>status of 400 (Bad Request)</p>
  </blockquote>