Blahbox Support Center
            Knowledge Base Blahbox Rich Messaging Amazon Lex

            Amazon Lex - List - Lambda

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

            Code for Lambda function:
            1. exports.handler =  (event, context, callback) => {
            2.     var bboxResponse = {};
            3.     bboxResponse = {
            4.           "bbox_list": {
            5.             "items": [
            6.               {
            7.                 "title": "United State",
            8.                 "imageUri": "https://cdn1.eminza.com/images/product/600/034/6/034636/alfombra-velours-redonda-bandera-americana.jpg",
            9.                 "textToSend": "United State",
            10.                 "description": "Amazing Country"
            11.               },
            12.               {
            13.                 "title": "Italy",
            14.                 "imageUri": "https://previews.123rf.com/images/itana/itana1710/itana171000147/88367248-bandera-de-italia-en-forma-de-un-bot%C3%B3n-redondo-con-un-ligero-resplandor-y-una-sombra-el-s%C3%ADmbolo-del-d%C3%ADa-de-.jpg",
            15.                 "textToSend": "Italy",
            16.                 "description": "The best pasta"
            17.               },
            18.               {
            19.                 "title": "Spain",
            20.                 "imageUri": "https://previews.123rf.com/images/dvarg/dvarg1406/dvarg140601070/29186329-flag-of-spain-as-round-glossy-icon-button-with-spanish-flag.jpg",
            21.                 "textToSend": "Spain",
            22.                 "description": "Nice people"
            23.               }
            24.             ],
            25.             "title": "Countries"
            26.           }};
            27.     
            28.     callback(null, {
            29.         "dialogAction": {
            30.             "type": "Close",
            31.             "fulfillmentState": "Fulfilled",
            32.             "message":{
            33.                 "contentType": "CustomPayload",
            34.                 "content": JSON.stringify(bboxResponse)
            35.             }
            36.         }
            37.     });
            38. };


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


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