I am using this code to get the list of messages received. I like to get the media url of the image if the message is a MMS message. I can identify the MMS with num_media property.
I don't know how to the get media url. The document says about subresource_uris. I am not sure how to use this in this case.
$client = new Services_Twilio($AccountSid, $AuthToken);
$messages = $client->account->messages->getIterator(0, 5, array()) ;
$media = "";
foreach($messages as $sms) {
if ($sms->num_media > 0)
{
}
}
Twilio developer evangelist here.
The media attached to a message can be found by querying the Media list resource for that message. That's nice and easy in the PHP library as you need to loop over the
media
resource for the$sms
message. Like so:Let me know if that helps!