How to receiver audio file twilio whatsapp callback - twilio

In Twilio console WhatsApp setting I've config the A MESSAGE COMES IN callback for receiver message from WhatsApp user. If the user sends an image, the call back has a parameter is MediaUrl0 to get the image. But if a user sends an audio file, no param in the callback to get it.
Any way to get the audio file? Please help me. thank you.

Twilio developer evangelist here.
At this time, Twilio does not support incoming media in WhatsApp messages. This support is being worked on.

Related

Twilio unable to send recorded voicemail to SMS

I created a simple call screener using Twilio Studio Flows.
How it works:
Someone calls my Twilio number
A greeting is played
If they hang-up or record audio
Twilio sends a SMS text, with the audio recording URL, to my actual phone number
The Media URL value is {{widgets.RECORD_VM.RecordingUrl}} according to the docs
Visual:
Problem:
Most of the time, the Flow fails with ERROR - 11200
If I drill into one of the errors and replay the request, the audio recording is returned.
It feels like there needs to be a pause between the time the RECORD_VM step and SEND_SMS steps in the Flow.
Some pause to give Twilio time to write the audio recording to a database so it can be retrieved by the SEND_SMS step.
But it I don't see an option for this in Flow.
How should I troubleshoot and address this?
The fix ended up being:
Move {{widgets.RECORD_VM.RecordingUrl}} from the MEDIA URL field to the MESSAGE BODY field as shown.
(Thanks to Akash # Twilio Support!)

How can I send a MMS with original mediaUrl from twilio?

I am sending MMS through twilio rest api. I received message on phone but media preview is not visible.
Here is code:
MMS Preview:
I think twilio convert mediaUrl to tiny link that's why its preview not available.
when I click on twilio link media visible on web.
looking for help.
thank you
With Twilio you can only send MMS messages to numbers in the US and Canada. If you try to send an MMS to a number outside of those countries then Twilio will will convert the message to an SMS message with a URL link to the media, as in this case. You can read more about how this works in this article about the MMS Converter.
To see the media in the message, you need to ensure you are sending MMS messages to numbers in the US and Canada.
Previews can be shown from links, but it appears that is not working with the media in this case, possibly because the response is a redirect to the file in an S3 bucket. If you want to send images to phone numbers outside of the US and Canada I would recommend you send it as your own URL in the body of the message and ensure that the URL links directly to the image so that the SMS application can read it and preview it easily.

Why Twilio receiving only blank body if we send images/media from my mobile via WhatsApp application?

[twilio] [twilio-whatsapp]
I have successfully integrated Whastsapp beta provided by twilio and sending and receiving text working perfectly. Moreover with the one trick I am also able to send images from twilio to whtasapp but reverse flow is not working.
When I send media from mobile whatsapp application to twilio then twilio only receive black body. No text body no Media.
Am I doing something wrong?
Twilio developer evangelist here.
The Twilio API for WhatsApp doesn't yet support media. But it is being worked on.
I would still expect the text to come through, so if that's not the case then I recommend you contact Twilio support and give them some message SIDs where this happened and they will alert the WhatsApp team.

Fetch MessgaeSid (SmsSid) of the message i send. When Someone replies to my message

I am Developing a Sms Convesation Application using Twilio API. What My Application does is It Send SMS to Mobile device prompting some options to chose. Users should reply back with anyone of the given option. What i want is when someone replies back to my application, I want the MessageSid of sent message(Message sent from Application). How can I acheive this? Please Help me
Twilio evangelist here.
There is no way to get the sid of a previous message from an inbound message since we don't track that. The SMS protocol has no facility for a "conversation" in it so we don't know that the inbound message is a "reply" to anything.
What you need to do is store in your app the fact that you sent a text message to a specific phone number. Then when that user replies from that number you would be able to know that you had previously sent them a message.
Hope that helps.
Devin
I don't believe this is possible. SMS messages are "stateless", much like HTTP requests. The only thing you could use like a session id would be the phone number. What about tracking conversation history by mapping an array of MessageSids to the phone number?

Receive MMS message in Twillio

Does anyone know how I can receive an MMS through Twilio? I checked online and found software to receive an SMS but not an MMS, since it's a new feature. The number I have is MMS-enabled. If I can receive it through an app, on email, anything would help.
Twilio evangelist here.
As long as your Twilio phone number is MMS-enabled you can receive MMS messages with it. Twilio currently offers MMS-enabled Twilio phone numbers in Canada and MMS-enabled Twilio short codes in the US.
If someone sends an MMS to your Twilio phone number or short code, Twilio is going to make an HTTP request to the Messages URL you have configured for your phone number. That request is going to include a bunch of parameters:
https://www.twilio.com/docs/api/twiml/sms/twilio_request
For each media element included in the MMS message, the Twilio request will include a MediaUrl parameter that has a URL you can use to grab the media element.
Hope that helps.
If you have a twilio number, and it is indeed MMS enabled, you should first verify that it is actually getting where its supposed to go. Not only does the twilio number need to support MMS, whatever number you are sending needs to as well.
After you send a test MMS to your twilio number, log into you account and check the message log - if you don't see it there, one of your numbers isn't supported.
https://www.twilio.com/user/account/log/sms
if you can't see the message in the log, no code is going to help.
If the message is indeed making it to your twilio number, then this is the relevant documentation on how to receive MMS in your app:
https://www.twilio.com/docs/api/rest/message

Resources