$post = array( "phone" => "8822992929",
"ID" => 26,
"text" => "Dear Customer. Thank you for your purchase.");
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
/*$headers = array(
'Content-Length: 0',
'Content-Type: application/json; charset=us-ascii',
'token: xyz123456',
);*/
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
//curl_setopt($ch, CURLOPT_USERNAME, $username);
//curl_setopt($ch, CURLOPT_USERPWD, $password);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$result = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
It's a version I use for my php. You need to edit the $headers array to use json and also send the token. It's hard to tell, but I think you need data-raw as "POST-like" array, which then goes to the CURLOPT_POSTFIELDS, $post part. Username, password, are optional, you may need to change authentication too.