Sabtu, 12 Februari 2011

CONTOH API SMS GATEWAY UNTUK KIRIM SMS

Format Kirim SMS

http://sms-gateway.web.id/Web2SMS/sendbyhttp.php?username=xxx&mobile=xxx&messag
e=xxx&auth=xxxx


example:
http://sms-gateway.web.id/Web2SMS/sendbyhttp.php?username=demo&mobile=081273880001
&message=tes+sms+aja&auth=sf7sd8fsyf9sy388979878sfbsdsrw4werwr


keterangan :
  • username dan password kami berikan
  • mobile : nomor hp tujuan
  • auth = md5(username+password+Mobile)
CONTOH KODE PHP




$authx = "$nixapi_username$nixapi_password$mobile";
$auth = md5($authx);

$textp=urlencode($text);

$urlku="$nixapi_url/sendbyhttp.php?username=$nixapi_username&mobile=$mobile&message=$textp&auth=$auth";



$grab = getURL($urlku);


function getURL($url) {
$curlHandle = curl_init(); // init curl
curl_setopt($curlHandle, CURLOPT_URL, $url); // set the url to fetch
curl_setopt($curlHandle, CURLOPT_HEADER, 0);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlHandle, CURLOPT_TIMEOUT,30);
curl_setopt($curlHandle, CURLOPT_POST, 0);
$content = curl_exec($curlHandle);
curl_close($curlHandle);
return $content;
}

?>



Untuk contoh penggunaan API utk widget sms gratis klik 
http://nixsms-lab.blogspot.com/2011/02/contoh-kode-widget-sms-gratis-dengan.html


1 komentar: