Skip to content

Instantly share code, notes, and snippets.

@SendOTP
Last active February 1, 2016 08:44
Show Gist options
  • Save SendOTP/340e819fa07713d08839 to your computer and use it in GitHub Desktop.
Save SendOTP/340e819fa07713d08839 to your computer and use it in GitHub Desktop.
SendOTP : Check mobile number status : PHP sample code to verify request on server side in basic architecture
<?php
class SendOTPBasic {
private $baseUrl = "http://sendotp.msg91.com/api";
public function checkNumberStatus($request) {
$ch = curl_init($this->baseUrl+'/checkNumberStatus?refreshToken={REFRESH TOKEN}&countryCode={91}&mobileNumber={98XXXXX}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'application-key : Your-application-key'
));
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment