0
votes

I am building a bot so whenever a specific task is initiated I want to send an image to the user.

exports.handler = function(context, event, callback) {
    let response = {
      "actions": [
        {
            "show": {
                "body": "Twilio Owls",
                "images": [{
                    "label": "Original Owl",
                    "url": "https://demo.twilio.com/owl.png"

                }]
            }
         }]
    }
    callback(null, response)
    }

I tried using the above code inside my function and I have linked it to my Twilio autopilot task, It is working in the simulator, but when I am testing it on Whatsapp Image does not appear in the Whatsapp chat only body get displayed.

1

1 Answers

0
votes

I tested and received the owl image. I noticed have a rogue {, maybe that is it?

exports.handler = function(context, event, callback) {
    let response = {
      "actions": [
        {
            "show": {
                "body": "Twilio Owls",
                "images": [{
                    "label": "Original Owl",
                    "url": "https://demo.twilio.com/owl.png"

                }]
            }
         }]
    }
    callback(null, response)
    };