发送whatsapp交互式消息的列表类型的交互消息将失败。

发布于 2025-02-03 07:44:07 字数 2825 浏览 3 评论 0原文

我可以使用“按钮”类型和3个按钮发送交互式消息。 但是,以“列表”类型的方式发送交互式消息,并且同一图像标头失败了错误:

{
  "meta": {
    "api_status": "stable",
    "version": "2.39.4"
  },
  "errors": [
    {
      "code": 1008,
      "title": "Required parameter is missing",
      "details": "Failed building interactive message. Invalid Header."
    }
  ]
}

“列表“交互式消息”是否不支持“图像”标头而不在文档中说明它?

成功的“按钮”交互式有效负载(图像URL更改):

{
  "to": "972000000000",
  "type": "interactive",
  "interactive": {
    "body": {
      "text": "Select a branch for the takeaway by writing the name/number"
    },
    "action": {
      "buttons": [
        {
          "reply": {
            "id": "MQ==",
            "title": "1"
          },
          "type": "reply"
        },
        {
          "reply": {
            "id": "Mg==",
            "title": "2"
          },
          "type": "reply"
        }
      ]
    },
    "type": "button",
    "header": {
      "image": {
        "link": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png"
      },
      "type": "image"
    }
  }
}

成功的“按钮”交互式消息结果:

失败”列表“交互式有效负载(图像URL更改):

{
  "to": "972000000000",
  "type": "interactive",
  "interactive": {
    "body": {
      "text": "Select a branch for the takeaway by writing the name/number"
    },
    "action": {
      "button": "Options",
      "sections": [
        {
          "rows": [
            {
              "id": "MQ==",
              "title": "1"
            },
            {
              "id": "Mg==",
              "title": "2"
            },
            {
              "id": "Mw==",
              "title": "3"
            },
            {
              "id": "NA==",
              "title": "4"
            },
            {
              "id": "NQ==",
              "title": "5"
            },
            {
              "id": "Ng==",
              "title": "6"
            },
            {
              "id": "Nw==",
              "title": "7"
            },
            {
              "id": "OA==",
              "title": "8"
            },
            {
              "id": "OQ==",
              "title": "9"
            },
            {
              "id": "MTA=",
              "title": "10"
            }
          ]
        }
      ]
    },
    "type": "list",
    "header": {
      "image": {
        "link": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png"
      },
      "type": "image"
    }
  }
}

I am able to send interactive message with "button" type and 3 buttons with image header.
But sending interactive message with "list" type and same image header fails with error:

{
  "meta": {
    "api_status": "stable",
    "version": "2.39.4"
  },
  "errors": [
    {
      "code": 1008,
      "title": "Required parameter is missing",
      "details": "Failed building interactive message. Invalid Header."
    }
  ]
}

Is it possible that "list" interactive messages doesn't support "image" header without stating it in documentation?

Successful "button" interactive payload (image URL changed):

{
  "to": "972000000000",
  "type": "interactive",
  "interactive": {
    "body": {
      "text": "Select a branch for the takeaway by writing the name/number"
    },
    "action": {
      "buttons": [
        {
          "reply": {
            "id": "MQ==",
            "title": "1"
          },
          "type": "reply"
        },
        {
          "reply": {
            "id": "Mg==",
            "title": "2"
          },
          "type": "reply"
        }
      ]
    },
    "type": "button",
    "header": {
      "image": {
        "link": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png"
      },
      "type": "image"
    }
  }
}

Successful "button" interactive message result:
Successful button interactive message with image header

Failed "list" interactive payload (image URL changed):

{
  "to": "972000000000",
  "type": "interactive",
  "interactive": {
    "body": {
      "text": "Select a branch for the takeaway by writing the name/number"
    },
    "action": {
      "button": "Options",
      "sections": [
        {
          "rows": [
            {
              "id": "MQ==",
              "title": "1"
            },
            {
              "id": "Mg==",
              "title": "2"
            },
            {
              "id": "Mw==",
              "title": "3"
            },
            {
              "id": "NA==",
              "title": "4"
            },
            {
              "id": "NQ==",
              "title": "5"
            },
            {
              "id": "Ng==",
              "title": "6"
            },
            {
              "id": "Nw==",
              "title": "7"
            },
            {
              "id": "OA==",
              "title": "8"
            },
            {
              "id": "OQ==",
              "title": "9"
            },
            {
              "id": "MTA=",
              "title": "10"
            }
          ]
        }
      ]
    },
    "type": "list",
    "header": {
      "image": {
        "link": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png"
      },
      "type": "image"
    }
  }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瑕疵 2025-02-10 07:44:07

好吧,它确实在文档中指出。我只是盲目:

”“在此处输入图像描述”

有点奇怪的是“图像”标题不支持“列表”。

Well, it does state it in the docs. I'm just blind:

enter image description here

Kinda weird though "image" header not supported for "list".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文