Amazon Lex - Carousel - Lambda

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:


    • Related Articles

    • Integrate Amazon Lex

      This article will help you set up Amazon Lex in Blahbox. To access the Amazon Lex trained bot, you must first of all obtain certain information from the AWS platform Data required: User Credentials Bot name, Alias and Version Region Link ...
    • Amazon Lex - Carousel

      A Carousel is a type of response that a virtual assistant trained with Amazon Lex can send to the user in order to improve the usability experience using images as a Carousel. Click here for more information. ...
    • Amazon Lex - Card - Lambda

      With Blahbox, it's possible to send a Card to the virtual assistant's user using Lambda. Code for Lambda function: exports.handler =  (event, context, callback) => {     callback(null, {         "dialogAction": {             "type": "Close",         ...
    • Amazon Lex - List - Lambda

      With Blahbox, it's possible to send a List to the virtual assistant's user using Lambda. Code for Lambda function: exports.handler =  (event, context, callback) => {     var bboxResponse = {};     bboxResponse = {           "bbox_list": {             ...
    • Dialogflow - Carousel Card

      A Carousel Card is a type of response that a virtual assistant trained with Dialogflow can send to the user in order to improve the usability experience using images as a Carousel. Click here for more information. ...