微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

通过存储在谷歌驱动器中的 WhatsApp Business API 发送 pdf,但我收到错误“12300 - 无效的内容类型”

如何解决通过存储在谷歌驱动器中的 WhatsApp Business API 发送 pdf,但我收到错误“12300 - 无效的内容类型”

我正在尝试通过存储在谷歌驱动器中的 WhatsApp Business API 发送 pdf,但我收到错误“12300 - 无效的内容类型”你能帮我我哪里出错了吗,我想知道如何从我的本地存储发送 MediaUrl 中的 pdf。我尝试使用 Twilio Assets,但它也不起作用。这是我的代码

 static void Main(string[] args)
{
    var accountSid = " ";
    var authToken = " ";
    TwilioClient.Init(accountSid,authToken);
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    var mediaUrl = new[] {
        new Uri("google drive link")
    }.ToList();
    
    var messageOptions = new CreateMessageOptions(
        new PhoneNumber("whatsapp:+91XXXXXX"));
    messageOptions.From = new PhoneNumber("whatsapp:+XXXXXXXX");
    messageOptions.Body = "Hello how are you?";
    messageOptions.MediaUrl = mediaUrl;
    var message = MessageResource.Create(messageOptions);
    Console.WriteLine(message.Body);
    Console.ReadLine();

}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。