$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://www.voxio.chat/external-api/inbox/send-template-message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'mobile_code' => '880',
'mobile' => 'xxxxxx',
'template_id' => 'your template id',
'from_number' => '6281234567890',
'header_variables[0]' => 'Customer Name',
'body_variables[0]' => 'INV-1001',
'body_variables[1]' => 'Rp500.000'
),
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;