I’m building a Lambda function to catch webhook events from Genesys Cloud for WFM adherence alerts. The payload comes in via API Gateway, but I can’t seem to parse the data object correctly in Node.js 18. Here’s the snippet I’m using:
exports.handler = async (event) => {
const payload = JSON.parse(event.body);
console.log(payload.data);
};
I keep getting undefined when logging payload.data. The raw event shows the structure is nested differently than the docs suggest.
- Node.js 18 runtime
- API Gateway REST API
- Webhook type:
routing.queue.member.status - Tried
event.bodyandevent.data
Any ideas on the correct path?