twiliotwilio-apitwilio-twimltwilio-programmable-chattwilio-click-to-call

how to send excel file by using twilio in C#


below is my code to send Excel file

       TwilioClient.Init(AccountSid, AuthToken);
       
       
        var mediaUrl = new List<Uri>();
        if (!string.IsNullOrEmpty(UriString))
        {
            mediaUrl = new[] {
                new Uri(UriString), //here I am passing url of Excel
            }.ToList();
        }

        var message1 = MessageResource.Create(               
           to: new PhoneNumber("whatsapp:" + ToNumber), from: new PhoneNumber("whatsapp:" + FromNumber),              
           body: message,
           mediaUrl: mediaUrl
         );

but, I am getting below error,

(Error: 11200) HTTP retrieval failure There was a failure attempting to retrieve the contents of this URL.

What should I do?

Thanks in advance.


Solution

  • Here are the supported WhatsApp MIME types (don't see application/vnd.ms-excel on the list).