简体   繁体   English

从 Twilio 为 Whatsapp 发送 ics 文件 REST API

[英]Send ics File from Twilio for Whatsapp REST API

I need to send a Calendar file (ICS) from the REST Api but i can`t.我需要从 REST Api 发送日历文件 (ICS),但我不能。

Nevertheless, I could send a jpg file.不过,我可以发送一个 jpg 文件。 In this article Twilio staff announced that users can send images and videos, but also PDFs, text files, and audio files using the Twilio API for WhatsApp.这篇文章中 Twilio 工作人员宣布,用户可以使用 WhatsApp 的 Twilio API 发送图像和视频,还可以发送 PDF、文本文件和音频文件。

This is my call with JPG file that attach the media in a whatsapp message OK:这是我对 JPG 文件的调用,该文件将媒体附加在 whatsapp 消息中 OK:

curl -X POST \
https://api.twilio.com/2010-04-01/Accounts/ACYYYYYYYYYYYYYYYYY/Messages.json \
-H 'authorization: Basic 
XXXXXXXXXXXXX' \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'postman-token: 58fa6aca-3b92-66d4-f675-9906bed37302' \
-d 'To=whatsapp%3A%2BXXXXXXXX&From=whatsapp%3A%2BYYYYYYY&Body=Hola%20probando2&MediaUrl=https%3A%2F%2Flh4.googleusercontent.com%2F-nbafRpNzZAc%2FWjHLp8y3NOI%2FAAAAAAAAAAA%2Fc8CSoPlcgcAazvZFKSU3uYxwo3HZ7FVewCOQCEAE%2Fs128-c-k%2Fphoto.jpg%0A'

When i substitute MediaUrl path with a txt file path or ics file, the message wasn't attach the file:当我用 txt 文件路径或 ics 文件替换 MediaUrl 路径时,消息未附加文件:

for example something like this:例如这样的:

curl -X POST \
https://api.twilio.com/2010-04-01/Accounts/ACYYYYYYYYYYYYYYYYY/Messages.json \
-H 'authorization: Basic 
XXXXXXXXXXXXX' \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'postman-token: 58fa6aca-3b92-66d4-f675-9906bed37302' \
-d 'To=whatsapp%3A%2BXXXXXXXX&From=whatsapp%3A%2BYYYYYYY&Body=Hola%20probando2&MediaUrl=https:%2F%2Faaa.bbb.com%2Fccc%2Fcalendar.ics%0A'

Below is a list of supported file types, I don't see the files you are trying to send as supported types for the underlying WhatsApp Business API .以下是支持的文件类型列表,我没有看到您尝试发送的文件作为底层WhatsApp Business API的支持类型。

Sending and Receiving Media with WhatsApp Messaging on Twilio (Beta) 在 Twilio(测试版)上使用 WhatsApp 消息发送和接收媒体

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM