1

I am using following code to post message back to Amazone Lex

....


    var objItem = {
                "title": `(£${item.price} pw) ${item.street_name}`,
                "image_url": item.image_url,
                "subtitle": `${item.displayable_address}`,
                "buttons": [
                    {
                        "type": "web_url",
                        "url": `${item.details_url}`,
                        "title": "View"
                    }, {
                        "type": "postback",
                        "title": "Book Item",
                        "payload": {vid:"CAL00002"}
                    }
                ]
            }

....

When the button "Book Item",is clicked,currently, the message "payload": {vid:"CAL00002"} will be sent back to Amazon Lex. it seems that Amazon Lex don't know this message, so I can NOT get this object in Amazon Lambda functions. here I am using Amazon Lex as AI to learn user's intent, and then all business logic is implemented in Amazon Lambda. in this situation, how can I post message back to Lambda? or Is there a way to post structured message back to Lex?

Yuhua Deng
  • 73
  • 1
  • 8

1 Answers1

0

I'm not sure how you are sending message back to Lambda, but I'm using AWS SDK to do this. Whatever information I want Lambda to get, I put it in sessionAttributes to pass.

Duy Nguyen
  • 155
  • 1
  • 9