'Response card with attachment returned to Lex from Lambda doesn't contain attachment

I use AWS Lambda function written in Python to return a response card with an attachment (according to https://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html#using-lambda-response-format and Hyperlink in response card button in Amazon Lex). However, I have no possibility to get access to the attachment, i.e. I can't click neither to the image nor to any other place to open the link.

Sample code is below and the result (including the response card) in on the image. image
(source: imggmi.com)

def close_response_card(session_attributes, fulfillment_state, message):
    return {
    'sessionAttributes': session_attributes,
    "dialogAction": {
        "type": "Close",
        "fulfillmentState": fulfillment_state,
        'message': message,
        "responseCard": {
            "version": 1,
            "contentType": "application/vnd.amazonaws.card.generic",
            'genericAttachments': [
                {
                    'title': 'Here is a list of hospitals',
                    'subTitle': 'Below is a map',
                    'attachmentLinkUrl': 'https://www.google.com/maps/search/?api=1&query=nearby+hospitals',
                    'imageUrl': 'https://images.sftcdn.net/images/t_optimized,f_auto/p/95612986-96d5-11e6-af7c-00163ec9f5fa/3771854867/google-maps-screenshot.png'
            }
        ]
     }
  }
    }

I'd like to create a card which lets the user downloads some file after he or she clicks on the card.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source