Looking for a way to specify image path that's stored in local server in Whatsapp twilio api. I can send image via api using hosted image links but having difficulty specifying local file path. Can you help?
<?php
// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';
use Twilio\Rest\Client;
// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);
$message = $twilio->messages
->create("whatsapp:+15017122661", // to
[
"mediaUrl" => ["https://images.unsplash.com/photo-1545093149-618ce3bcf49d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=668&q=80"],
"from" => "whatsapp:+14155238886"
]
);
print($message->sid);
?>
In short, I want to know whether i can attach local image file to the message using the mediaURL attribute.