sms_test.php
1.45 KB
<?php
$url = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?';
//$url = 'https://push3.maccesssmspush.com/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?userId=hdfcbalrt&pass=hdfcbalrt25&appid=hdfcbalrt&subappid=hdfcbalrt&contenttype=1&to=8074030875&from=HDFCBK&text=manoj&selfid=true&alert=1&dlrreq=true&intflag=false';
$inputArray = ["userId"=>"hdfcbalrt","pass"=>"hdfcbalrt25","appid"=>"hdfcbalrt","subappid"=>"hdfcbalrt","contenttype"=>"1","to"=>"8074030875","from"=>"HDFCBK","text"=>"This%20is%20test%20SMS","selfid"=>"true","alert"=>"1","dlrreq"=>"true","intflag"=>"false"];
$payload = json_encode($inputArray);
//$payload = json_encode($jsonBody);
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIE, "");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json',
'AUTHORIZATIONKEY:' . $X_AUTH_T,
'X-EMAIL:' . $X_EMAIL_T, 'Cache-Control:no-cache'
));
$result=curl_exec($ch);
$errors=curl_error($ch);
$response = curl_getinfo($ch, CURLINFO_HTTP_CODE);
var_dump($result);
curl_close($ch);
echo $errors."<br/>";
echo $response;
?>