Amazon Lex - Card - Lambda

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:


    • 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 - Lambda

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

      A Card 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. Click here for more information. When Blahbox detects a Card, it interprets and ...
    • 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": {             ...
    • Amazon Lex - Suggestion Chips - Lambda

      With Blahbox, it's possible to send Suggestion Chips to the virtual assistant's user using Lambda. Code for Lambda function: exports.handler =  (event, context, callback) => {     var bboxResponse = {};     bboxResponse =  {   "bbox_suggestions": {   ...