Blahbox Support Center
            Knowledge Base Blahbox Rich Messaging Amazon Lex

            Amazon Lex - Carousel - Lambda

            With Blahboxit's possible to send a Carousel 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": "Dogs"
            9.             },
            10.             "responseCard": {
            11.     "contentType": "application/vnd.amazonaws.card.generic",
            12.     "genericAttachments": [
            13.       {
            14.         "attachmentLinkUrl": "https://www.blahbox.net/4steps",
            15.         "buttons": [
            16.           {
            17.             "text": "Dog 1",
            18.             "value": "Dog 1"
            19.           }
            20.         ],
            21.         "title": "Dog 1",
            22.         "subTitle": "This is the best dog",
            23.         "imageUrl": "https://estaticos.muyinteresante.es/media/cache/760x570_thumb/uploads/images/article/5c3871215bafe83b078adbe3/perro.jpg"
            24.       },
            25.       {
            26.         "attachmentLinkUrl": "https://www.blahbox.net/4steps",
            27.         "buttons": [
            28.           {
            29.             "text": "Dog 2",
            30.             "value": "Dog 2"
            31.           }
            32.         ],
            33.         "title": "Dog 2",
            34.         "subTitle": "Real Friend!!",
            35.         "imageUrl": "https://fotografias.lasexta.com/clipping/cmsimages01/2017/02/07/364CAAAC-A60E-43BB-8FED-05AA0B8F3AF9/58.jpg"
            36.        }
            37.     ],
            38.     "version": "1"
            39.   }
            40.         }
            41.     });
            42. };


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


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