Skip to content

Instantly share code, notes, and snippets.

@pasindud
Created September 2, 2014 16:18
Show Gist options
  • Save pasindud/8b8661e8a055a4dfdde7 to your computer and use it in GitHub Desktop.
Save pasindud/8b8661e8a055a4dfdde7 to your computer and use it in GitHub Desktop.
Basic Ideamart Send n Recieve SMS
<?php
function sendSMS ($message ,$addresses ,$applicationId , $password ){
$req = array("message"=>$message,
"destinationAddresses"=>$addresses,
"applicationId"=>$applicationId,
"password"=>$password);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($req));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
return json_decode($res);
}
function recieveSMS(){
$req = json_decode(file_get_contents('php://input'));
$response = array('statusCode'=>'S1000','statusDetail'=>'Process completed successfully.');
header('Content-type: application/json');
echo json_encode($response);
return $req;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment