#bogo-webhook-awslambda

1 messages ยท Page 1 of 1 (latest)

somber bayBOT
snow gate
#

bogo-webhook-awslambda

#

Hey @rigid temple AWS Lambda makes this really tricky because it touches the raw payload

rigid temple
#

yup, I'm aware!

snow gate
#

We have some old obscure docs internally about this where we recommend something that looks like { "method": "$context.httpMethod", "body": $input.json('$'), "rawBody": "$util.escapeJavaScript($input.body).replaceAll("\\'", "'")", "headers": { #foreach($param in $input.params().header.keySet()) "$param": "$util.escapeJavaScript($input.params().header.get($param))" #if($foreach.hasNext),#end #end } }

#

I'm hoping you know what that does/mean and can tweak it your way? ๐Ÿ˜…

rigid temple
#

I'll try it! Do you know if there's anything that I have to do if there's an Apigateway in front of it and how that handles raw bodys?

snow gate
#

I have never used this so I'm not sure. But in our internal docs we say: ```First, in API Gateway, users should set up a Body Mapping Template like this:

Content-Type: application/json (just this โ€“ do not include ; charset=utf-8 afterwards)
Template contents:``` (and then that's what I shared above that's the content)

rigid temple
snow gate
#

no, I've never used this tool. It's somewhere in the "Body Mapping Template"

rigid temple
#

do you know how to remove the "charset=utf-8", I'm not including it in my swagger but when i log the "events", here is the response i get

#

it seems to be using charset-utf8 on the headres

#

as well as rawBody not showing up

snow gate
#

I'm sorry I do not, I've never used any of this and neither has anyone on my team

#

You might need to ask AWS' own support team in that case

rigid temple
#

is there more info on the that internal doc that you can provide?

snow gate
#

no I shared everything