|## The `substring(8)` returns the input with everything after "payload=" which is the only parameter passed in,|
|## everything else is encoded JSON inside that parameter.|
|#set ($encodedJSON = $input.body.substring(8))|
This isn't the most elegant mapping template ever, but it's what I used to get this payload transformed into JSON for an AWS Lambda function. Add this as an Integration Request Body Mapping Template in API Gateway, for the Content Type
EDIT: I was making a novice mistake and hadn't deployed the API changes.
I added this mapping template but am still receiving the same error. First time using API Gateway + Lambda, so if there are any gotchas I could be missing in the setup, like needing to publish changes to the API Gateway or something please let me know.