<?php
$pathgbr = "/var/www/123/coba.jpg";
$imageData = file_get_contents($pathgbr);
$base64Image = base64_encode($imageData);
$postData = array(
'phone' => '+6285312345678',
'image' => '$base64Image',
'caption' => "coba"
);
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => "Access-Token: {$authToken}\r\n".
"Content-Type: application/json\r\n",
'content' => json_encode($postData)
)
));
$response = file_get_contents('
http://10.168.123.123:8080/api/send', FALSE, $context);
if($response === FALSE){
die('Error');
}
$responseData = json_decode($response, TRUE);
print_r($responseData);