AWS API Gateway - How do I get the date/timestamp/epoch in a body mapping template?
I need to include the request time in the body mapping template for an API Gateway method. Is there a date/time variable or function? I couldn't find anything in the template reference . Example body mapping template: Action=SendMessage&MessageBody=$util.urlEncode("{""timestamp"":""TIMESTAMP_HERE"",""body-json"":$input.json('$'),""params"":""$input.params()""}") UPDATE: API Gateway just added two new context variables http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html $context.requestTime The CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss