Blahbox Support Center
            Knowledge Base Blahbox Rich Messaging Amazon Lex

            Amazon Lex - Card - Lambda

            With Blahboxit's possible to send a Card to the virtual assistant's user using Lambda.

            Code for Lambda function:
            1. exports.handler =  (event, context, callback) => {
            2.     callback(null, {
            3.         "dialogAction": {
            4.             "type": "Close",
            5.             "fulfillmentState": "Fulfilled",
            6.             "message":{
            7.                 "contentType": "PlainText",
            8.                 "content": "Shoes"
            9.             },
            10.   "responseCard": {
            11.     "contentType": "application/vnd.amazonaws.card.generic",
            12.     "genericAttachments": [
            13.       {
            14.         "attachmentLinkUrl": "https://www.blahbox.net/",
            15.         "buttons": [
            16.           {
            17.             "text": "Buy",
            18.             "value": "I want to buy it"
            19.           },
            20.           {
            21.             "text": "More Info",
            22.             "value": "More Info"
            23.           }
            24.         ],
            25.         "imageUrl": "https://d3u67r7pp2lrq5.cloudfront.net/product_photos/29451960/2_original.jpg",
            26.         "subTitle": "Nice Black Shoes",
            27.         "title": "Men Shoes"
            28.       }
            29.     ],
            30.     "version": "1"
            31.   },
            32.         }
            33.     });
            34. };


            Blahbox interprets the Lambda response and shows it to the user as is shown below:


            Updated: 09 Dec 2019 05:30 AM
            Helpful?  
            Help us to make this article better
            0 0