Error sending card with an image using Bot Connector

Hi,

First, we are using Genesys Bot Connector on an Architect Inbound Message Flow to connect Genesys Cloud with an external bot hosted in our platform. This flow is used to manage Whatsapp conversations.

One of our customer's requirements is to send images from our external bot but when it sends the exact postUtterance Response example got from Genesys docs (attached below), the conversation fails and is transferred to an agent.

https://developer.genesys.cloud/commdigital/textbots/examples/botconnector-card-example

Could you help us to solve the problem and to send images from our external bot using Genesys Bot Connector and Whatsapp channel?

On the other hand, if we test the same flow with webchat channel (using Messenger Deployment), we can send images from our bot. This is the response with the image that the bot sends:

{"replymessages":[{"type":"Structured","content":[{"contentType":"Card","card":{"title":" ","description":"Hola :grinning:","image":https://www.gstatic.com/webp/gallery/4.sm.jpg,"actions":[{"type":"Link","text":"Open","url":https://www.gstatic.com/webp/gallery/4.sm.jpg}]}}]}],"botState":"MOREDATA","intent":"end","slotValues":{"slot":"0.155468991943019"},"parameters":{}}

If we send this exact response on Whatsapp channel, it doesn’t work.

Thanks in advance.

Regards,

Hello,

I don't have a WhatsApp integration but I would assume your issue is related to the limitations highlighted in Work with cards in bot conversations - paragraph on " Considerations for cards implementation" - section on "Cards and WhatsApp Messenger".
As an example on "actions": "WhatsApp does not support actions. On other platforms, you can set an overall action that is performed when you click an image on a card, an action occurs. With WhatsApp, if you include an overall action such as actions , an error occurs."

Regards,

Hi Jerome,

Thank you for your answer.

We have tested the same postutterance response without actions but an error occurs same as before.

This is the response the our bot sends to Genesys Cloud:

{

            "replymessages":

            [

                {

                    "type":"Structured",

                    "content" : [

                        {

                            "contentType": "Card",

                            "card": {

                                "title": "50% off Flights to Norway",

                                "description": "Valid September to November only",

                                "image": "https://img.freepik.com/free-vector/tree-transparent-background_1308-74201.jpg?size=626&ext=jpg",

                                "defaultAction": {

                                    "type": "Link",

                                    "url": "https://img.freepik.com/free-vector/tree-transparent-background_1308-74201.jpg?size=626&ext=jpg"

                                }

                            }

                        }

                    ]

                }

            ],

            "intent" : "orderCookie",

            "confidence" : 0.5,

            "botState": "COMPLETE",

            "slotValues":

            {

                "slotString" : "value1",

                "slotStringCollection" : [ "alpha", "beta", "delta" ],

                "slotInteger" : 27,

                "slotDuration" : "P1D",

                "slotDecimal" : 3.14,

                "slotBoolean" : true,

                "slotDateTime" : "1955-11-05T12:00:00",

                "slotCurrency" : { "amount" : "5.00", "code" : "USD" },

                "slotCurrency2" : "17.00|USD"

            },

            "errorInfo":

            {

                "errorCode": "xxx",

                "errorMessage": "A description of the error"

            },

            "parameters":

            {

                "parameter1" : "value1",

                "parameter2" : "value2"

            }

        }

What if you try without defaultAction.
As I said, I don't have a WhatsApp integration in my environment. But as the article I referenced says: " WhatsApp does not support actions.", I would try without the defaultAction first to see if that works in this case.
Moreover, I think you either need a title or an image. As it is explained "Cards that include an image or video do not display a title. When you use text only, the title displays."

If you think you are following these constraints and you think it still doesn't work, please open a ticket with Customer Care. We do not have the ability and right to access and to investigate customer data and logs from this forum.

Regards,

Hi again Jerome,

I have tried without defaultAction and title and it doesn't work.

We already opened a Customer Care ticket but this is their answer:

"Hi,

I hope you're doing well.

My name is Rex from API and Integrations Team and I wanted to reach out to you to provide an update on your case. Your request for a sample postUtterance Response has been forwarded to our Team for further assistance. I understand that you've been having trouble with the example provided in our Resource Center, https://developer.genesys.cloud/commdigital/textbots/examples/botconnector-card-example. Unfortunately, that is the only documentation available at the moment.

Another option you might consider is to share your use-case on our Dev Community Forum at https://developer.genesys.cloud/forum/. Our Support Team is best equipped to handle break/fix related issues, but for queries that involve custom implementation, programming, and coding, our Developers on the forum would be the best people to consult.

Finally, you can also engage our Professional Services through your CSM/TAM. They can provide you with their best recommendation on how to implement this type of setup in your organization.

If you have any other questions, please don't hesitate to reach out to us.

*Best regards,"

Hello,

I have been able to test the Card response, sent via Bot Connector, to a WhatsApp customer, and I could display it properly on WhatsApp side (given the constraints listed below).

To explain the constraints which are described in the Resource Center article:

WhatsApp support is limited to text back buttons - minium 1 must be provided - maximum 3.
It means that in the bot response, the actions array can only contain elements of type "Postback" (text back button) and do not support type "Link" (clickable url).
WhatsApp does not support the defaultAction in the bot response for Card.
WhatsApp will either display the image (if attribute is provided, with title), or will display the title (if image attribute is not provided).

Here is the bot responses I have sent.
I have used the bot list example to define my bot. That's why intent is set to OrderCookie (matching my bot definition) and why my slotValues are named CookieType and NumOfCookies (matching my bot definition).

Will display image, description and two buttons (Text Back buttons):

{
    "replymessages": [
        {
            "type": "Structured",
            "content": [
                {
                    "contentType": "Card",
                    "card": {
                        "title": "50% off Flights to Norway",
                        "description": "Valid September to November only",
                        "image": "https://www.gstatic.com/webp/gallery/4.sm.jpg",
                        "actions": [
                            {
                                "type": "Postback",
                                "text": "Book Now",
                                "payload": "I want it"
                            },
                            {
                                "type": "Postback",
                                "text": "Book Later",
                                "payload": "I will think about it"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "intent": "OrderCookie",
    "confidence": 0.9,
    "botState": "MOREDATA",
    "slotValues": {
        "CookieType": "chocolate",
        "NumOfCookies": 0
    }
}

Will display title, description and two buttons (Text Back buttons):

{
    "replymessages": [
        {
            "type": "Structured",
            "content": [
                {
                    "contentType": "Card",
                    "card": {
                        "title": "50% off Flights to Norway",
                        "description": "Valid September to November only",
                        "actions": [
                            {
                                "type": "Postback",
                                "text": "Book Now",
                                "payload": "I want it"
                            },
                            {
                                "type": "Postback",
                                "text": "Book Later",
                                "payload": "I will think about it"
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "intent": "OrderCookie",
    "confidence": 0.9,
    "botState": "MOREDATA",
    "slotValues": {
        "CookieType": "chocolate",
        "NumOfCookies": 0
    }
}

Regards,

Hello,

I could display an image on Whatsapp side using your bot response.

Thank you very much for your help.

Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.