C# AUTH
using (WebClient client = new WebClient())
{
client.Headers.Add("Authorization", "YOUR_ACCESS_KEY");
}
using (WebClient client = new WebClient())
{
client.Headers.Add("Authorization", "YOUR_ACCESS_KEY");
}
www.DOMAIN.com/HLR_PAGE.aspx?mobilenumber=353870000000&status=0&mncid=27201&customerid=12345
www.DOMAIN.com/REPLY_PAGE.aspx?mobilenumber=27870000000&command=Hello World Reply&sentto=27871234567
www.DOMAIN.com/DLR_PAGE.aspx?EventID=32433326&Phonenumber=27870000000&DataType=SMS &Status=DELIVRD&CustomerID=YOUR_PASSED_CUSTOMER_ID
{
"status":"OK",
"statusCode":0,
"mobilenumber":"0870000000",
"customerid":"-1",
"acceptedDateTime":"2017-08-29T12:26:56.1348586+01:00"
}
$url = 'https://rest.sendmode.com/v2/hlr';
$data = array('mobilenumber' => '0870000000');
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n" .
"Authorization: YOUR_ACCESS_KEY\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
using (WebClient client = new WebClient())
{
client.Headers.Add("Authorization", "YOUR_ACCESS_KEY");
byte[] response =
client.UploadValues("http://rest.sendmode.com/v2/hlr", new NameValueCollection()
{
{ "mobilenumber", "0870000000" }
});
string result = System.Text.Encoding.UTF8.GetString(response);
}
{
"status":"OK",
"statusCode":0,
"message":{
"recipient":"353852455041",
"code":"78b6",
"expireDatetime":"29/08/2017 13:42:52",
"status":"VERIFIED",
"verifiedDate":"29/08/2017 11:43:31"
}
}
HttpClient httpclient = HttpClients.createDefault();
HttpPost httppost = new HttpPost("https://rest.sendmode.com/v2/verify");
httppost.setHeader(HttpHeaders.AUTHORIZATION, YOUR_ACCESS_KEY);
List<NameValuePair> params = new ArrayList<NameValuePair>(2);
params.add(new BasicNameValuePair("code", "2FA_CODE"));
params.add(new BasicNameValuePair("recipient", "0870000000"));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
$url = 'https://rest.sendmode.com/v2/verify';
$data = array('code' => '2FA_CODE', 'recipient' => '0870000000');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n" .
"Authorization: YOUR_ACCESS_KEY\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);