How to set preview_url in Facebook Cloud API Whatsapp template message

79 Views Asked by At

When sending a text message in Whatsapp using the Facebook cloud API, I can set preview_url in oder to enable link previews in the message as follows:

{
    "messaging_product": "whatsapp",
    "to": "XXX",
    "type": "text",
    "text":
    {
        "body": "SOME_LINK",
        "preview_url": true
    }
}

I cannot make this work when sending a template message as in:

{
    "messaging_product": "whatsapp",
    "to": "XXX",
    "type": "template",
    "template":
    {
        "name": "TEMPLATE_NAME",
        "language":
        {
            "code": "en"
        },
        "components": [
        {
            "type": "body",
            "parameters": [
            {
                "type": "text",
                "text": "SOME_TEXT"
            },
            {
                "type": "text",
                "text": "SOME_LINK"
            }]
        }]
    }
}

where do I have to put the preview_url in that case?

0

There are 0 best solutions below