I want to store the inputs given in Amazon Lex Chatbot in Amazon DynamoDB via Lambda Integration. How to handle the Responses from Amazon Lambda. I am receiving the error as - ( An error has occurred: Invalid Lambda Response: Received invalid response from Lambda: Unexpected token (END_OBJECT), expected FIELD_NAME: missing property 'type' that is to contain type id (for class DialogAction) at [Source: {"dialogAction":{"Type":"Close","fulfillmentState":"failed","message":{"ContentType":"PlainText","Content":"Hey null, Your Requested nullTickets on null at null"}}}; line: 1, column: 164] )
Kindly help on this. My Amazon Lambda Code is as below,
exports.handler = (event, context, callback) => {
var Name = event.currentIntent.slots.Name;
var TicketType = event.currentIntent.slots.TicketType;
var BookingDate = event.currentIntent.slots.BookingDate;
var BookingTime = event.currentIntent.slots.BookingTime;
callback(null, {
"dialogAction": {
"Type":"Close",
"fulfillmentState": "failed",
"message": {
"ContentType": "PlainText",
"Content": "Hey " +Name+ ", Your Requested "+ TicketType + "Tickets on " +BookingDate+" at " +BookingTime+"" ,
}
}
})
}