1

I am using .NET core with react template I am using twilio for WhatsApp messages, and it is working fine. Even I am able to send image file also.

but when i am sending a video I am not receiving any message.

My code

TwilioClient.Init(_accountSID, _authToken);

string mediaUrlString = null;
Uri mediaUri = null;
List<Uri> mediaUrls = null;
messageDto.MediaUrl = "https://videos.pexels.com/video-files/4114797/4114797-uhd_2560_1440_25fps.mp4";

if (!String.IsNullOrEmpty(messageDto.MediaUrl))
{
    mediaUrlString = messageDto.MediaUrl;
    mediaUri = new Uri(mediaUrlString);
    mediaUrls = new List<Uri> { mediaUri };
}

var message = await MessageResource.CreateAsync(
            //   from: new Twilio.Types.PhoneNumber(_twilioWhatsAppNumber),
               from: new Twilio.Types.PhoneNumber("My-Twilio-Number``your text``"),
               body: messageDto.SMSBody,
               mediaUrl: mediaUrls,
               to: new Twilio.Types.PhoneNumber("whatsapp:+" + messageDto.ToPhoneNumber),
               statusCallback: new Uri(baseUrl+ "/Support/ReceiveWhatsAppStatus"));

For now I am using above url which is publicly accessible

what could be the issue

I'm expecting where I am making mistake, and how to resolve this

In the image You can see a link "Invalid content"

Here is the link :

enter image description here

7
  • Are you receiving any errors?
    – DarkBee
    Commented yesterday
  • No I am not receiving any error. I have read some where "If media is not valid it will fail silently without any error" Some thing like this. Commented yesterday
  • Hey I have attached the logs of twilio console can You check please Thank you Commented yesterday
  • Did you click on the link to troubleshoot the warning?
    – DarkBee
    Commented yesterday
  • Yes, and all the points are being satisfied First I was using my own file which is dynamic, publicly accessible etc.. when it does not work I am using this static url, and getting same issue. Commented yesterday

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.