Challenge with node Webhook

I am trying to connect my webhook up and have the challenge console logging on the lambda function, so I know it is not my gateway connection or my lambda function. What am I doing wrong in the return?! Below is the code. exports.handler = event => {
console.log( {“challenge”: JSON.parse(event.body).challenge});
return event.body;
};

Finally got it to work. Below is my index.js file using node.js

exports.handler = async event => {
  console.log( {"challenge": JSON.parse(event.body).challenge});
  const response = {
    statusCode: 200,
    body: event.body
    
  };
  console.log(response);
  return response;
};
1 Like

Amazing! Glad you got it working.

2 Likes