WhatsApp API 模板消息未发送视频

问题描述 投票:0回答:1

我正在尝试使用 WhatsApp API 以及包含视频的模板发送 WhatsApp 消息。当我发送没有媒体内容的模板时,它们会成功传送。但是,当我在模板中包含视频时,消息不会在没有任何错误消息的情况下发送。

这是我正在使用的代码:

{
"messaging_product": "whatsapp",
"to": "01123456789",
"type": "template",
"template": {
    "namespace": "your-trainer",
    "name": "my_template_name",
    "language": {
        "code": "DE",
        "policy": "deterministic"
    },
    "components": [
        {
            "type": "header",
            "parameters": [
                {
                    "type": "video",
                    "video": {
                        "link": "https://scontent.whatsapp.net/v/t61....."
                    }
                }
            ]
        },
        {
            "type": "body",
            "parameters": [
                {
                    "type": "text",
                    "text": "Some custom text for variable"
                }
            ]
        }
    ]
}}

这是我的模板:

    "data": [
    {
        "name": "my_template_name",
        "components": [
            {
                "type": "HEADER",
                "format": "VIDEO",
                "example": {
                    "header_handle": [
                        "https://scontent.whatsapp.net/v/t61..."
                    ]
                }
            },
            {
                "type": "BODY",
                "text": "Hallo {{1}}\n\",
                "example": {
                    "body_text": [
                        [
                            "stackoverflow"
                        ]
                    ]
                }
            },
            {
                "type": "FOOTER",
                "text": "Some Footer-Text"
            },
            {
                "type": "BUTTONS",
                "buttons": [
                    {
                        "type": "QUICK_REPLY",
                        "text": "Promotions stoppen"
                    }
                ]
            }
        ],
        "language": "de",
        "status": "APPROVED",
        "category": "MARKETING",
        "id": "myid"
    }

这是回复

{
"messaging_product": "whatsapp",
"contacts": [
    {
        "input": "1234567899",
        "wa_id": "1234567899"
    }
],
"messages": [
    {
        "id": "wamid.HBgLNDE3OTQ2NDg4NjYVAgARGDFSDFSDFSDF"
    }
]}

我做错了什么吗?

facebook-graph-api whatsapp-cloud-api
1个回答
1
投票

解决方案是通过Upload API上传视频,然后使用videoId。

参见: https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media

© www.soinside.com 2019 - 2024. All rights reserved.