Whatsapp API 发送文档媒体消息

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

我正在尝试在 Whatsapp Business API 中发送文档媒体消息 使用 LINK 而不是上传文件。但我收到以下错误:

"errors":[  
      {  
         "code":1008,
         "title":"Required parameter is missing",
         "details":"Parameter 'id' is mandatory for type 'document'"
      }
   ]

这是 JSON 请求对象:

{  
   "recipient_type":"individual",
   "to":"TELEPHONE_NUMBER_HIDDEN",
   "type":"document",
   "document":{  
      "link":"google-drive/https://drive.google.com/open?id=HIDDEN_DOCUMENT_ID",
      "provider":{  
         "name":"google-drive"
      },
      "caption":"CAPTION MESSAGE"
   }
}

你们对此有什么想法吗? 我无法使用 Twilio 等外部服务。

image api media document whatsapp
1个回答
0
投票

如果您使用的是 cloud API 而不是 On-premises API,则删除该“provider”选项。

{
  "messaging_product": "whatsapp",
  "to": "TELEPHONE_NUMBER_HIDDEN",
  "type": "document",
  "document": {
    "link":"LINK_HERE",
    "filename": "OPTIONAL_FILENAME"
 }
© www.soinside.com 2019 - 2024. All rights reserved.