You should try to do something from your side and mention it on the question. Anyways here’s the solution for your problem
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.mydomain.in/api/comm/wa/send/text',
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 =>'{
"phone": "8822992929",
"ID": 26,
"text": "Dear Customer. Thank you for your purchase. "
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'token: xyz123456'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
0
solved How to curl via php [closed]