title: AWS API Gateway how to get the time stamp in Integration Request > Body Mapping Templates
body: <p>Is it possible to retrieve the time stamp of the API gateway request in the Body Mapping Template of the Integration Request so it can only retrieve records that are greater than (or less than) the creation date?</p>
  
  <p><strong>Current Set up</strong></p>
  
  <p>API Gateway (GET) -> DynamoDB -- <em>Response</em> --> API Gateway</p>
  
  <p><strong>Body Mapping Template</strong></p>
  
  <pre><code>{
  "TableName": "table-name-in-dynamodb",
  "ScanFilter": {
    "creationDate": {
      "AttributeValueList": [ { "N":"TIMESTAMP_OF_THE_API_REQUEST" } ],
      "ComparisonOperator": "GT"
    }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I have read that the header <strong>X-Amzn-Trace-Id</strong> can be retrieved with $input.params('X-Amzn-Trace-Id') which will return a string with the version number and time stamp.
  <a href="https://stackoverflow.com/questions/41194492/aws-api-gateway-how-do-i-get-the-date-timestamp-epoch-in-a-body-mapping-templa">AWS API Gateway - How do I get the date/timestamp/epoch in a body mapping template?</a></p>
  
  <p>I am still pretty new to all of this so I'm not sure how I can process the data.</p>
  
  <p>Is this even possible?</p>