AWS API Gateway service page says that a Template Selection Expression can be used to implement a way to transform the request body. However the documentation for these selection expressions is very light and I haven't been able to find any examples.
To add content to the integration request, you'll need to use a Request Template. The Request Template is the piece that actually generates the new request body, while the Request Selection Template is used in the process of determining which Request Template to use.
\$default. Note the slash. Full documentation here.)$default. Note the absence of a slash.){
"myConnectionIdProperty": "$context.connectionId",
"myQueryParams": $input.params()
}
Documentation for variables available to you in the template expression can be found here.
(Note that while $request is a valid variable in the Template Selection Expression, it is not a valid variable in the template itself. Use $input instead there.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With