How to pass a querystring or route parameter to AWS Lambda from Amazon API Gateway

The Solution to How to pass a querystring or route parameter to AWS Lambda from Amazon API Gateway is


As of September 2017, you no longer have to configure mappings to access the request body.

All you need to do is check, "Use Lambda Proxy integration", under Integration Request, under the resource.

enter image description here

You'll then be able to access query parameters, path parameters and headers like so

event['pathParameters']['param1']
event["queryStringParameters"]['queryparam1']
event['requestContext']['identity']['userAgent']
event['requestContext']['identity']['sourceIP']

~ Answered on 2017-09-08 10:19:04


Most Viewed Questions: