I am using aws lambda to respond to a Dialogflow webhook via API gateway. I have added the webhook in fulfillment using basic auth. The lambda is successfully called (based on Cloudfront logs) and it returns a fulfillment_text response;
exports.handler = async (event, context) => {
return { fulfillmentText: 'IT WORKS' };
};
For some reason, I always get:
API RESPONSE
"webhookStatus": { "code": 13, "message": "Webhook call failed. Error: 502 Bad Gateway." }