What is the Difference Between SMS API and Developer SMS API? (Link to: https://www.osdigital.in/
SMS API is a very useful tool to integrate any software to the SMS application. This is a string which bridges between these two applications which work on application triggers. Once the application gives any command a predefined SMS template delivers to the mobile which has been integrated in the application. This is a very useful tool for two way authentication or security of any application. Today almost every application is using this service to integrate it at various places and commands of application to make them more secure. When we are going to the next level of development, security concerns are getting more important because competitors or hackers always want to steal the data and this authentication process avoids theft and the secure your data from the hackers.
SAMPLE SMS API STRING: http://182.18.144.233/V2/http-
Developer SMS API is a complete API program with the string, which helps you to integrate your application according to the developers language(ASP, .Net, C#, Java, Php etc.) in which your application has been developed. You can find here the sample code for different languages of Developers API. You can choose it according to your requirement.
1. SAMPLE CODE FOR ASP APPLICATION:
sResponse = SMSSend(pno, message )
If right(sResponse,15) = “Send Successful” Then
‘write your code here
End If
Function SMSSend (strPh,strMsg)
Dim msgResponse
Dim strRequest
Dim strUrl
msgResponse = “”
strPh=right(strPh,10)
If not IsNumeric(strPh) Or len(strPh) <> 10 Then
msgResponse = “Enter valid Mobile Number.”
End If
If strMsg = “” Then
msgResponse = “Enter text message.”
End If
strUrl = “http://182.18.144.233/V2/
strRequest = strRequest+”apikey=apikey”
strRequest = strRequest+”&senderid=
strRequest = strRequest+”&number=”+strPh
strRequest = strRequest+”&message=”+Server.
strUrl = strUrl+strRequest
If msgResponse = “” Then
Dim oXML
Dim sPage
Err.Clear
On Error Resume Next
Set oXML = Server.CreateObject(“Msxml2.
oXML.Open “get”, strUrl , false
oXML.Send
msgResponse = oXML.ResponseText
Set oXML = Nothing
End If
SMSSend = msgResponse
If Err.Number <> 0 Then
SMSSend = “Error on sending sms : “& Err.Description
End If
End Function
2. SAMPLE CODE FOR .NET APPLICATION:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.IO;
using System.Net;
public class Program
{
public static void Main()
{
WebClient client = new WebClient();
string baseurl = “http://182.18.144.233/V2/
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
Console.WriteLine(s);
data.Close();
reader.Close();
}
}
3. SAMPLE CODE FOR PHP APPLICATION:
‘– Use URLEncode for parameter msgtext
?php
$url = “http://182.18.144.233/V2/
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);
echo $curl_scraped_page;
?
4. SAMPLE CODE FOR JAVA APPLICATION:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Date;
public class SMSSend {
public static void main(String[] args)
{ try {
Date mydate = new Date(System.currentTimeMillis(
URL url = new URL(“http://182.18.144.233/V2/
HttpURLConnection conn = (HttpURLConnection)url.
conn.setRequestMethod(“GET”);
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);
conn.connect();
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.
String line;
StringBuffer buffer = new StringBuffer();
while ((line = rd.readLine()) != null)
{
buffer.append(line).append(“\
}
System.out.println(buffer.
rd.close();
conn.disconnect();
}catch(Exception e)
{ e.printStackTrace();
}
}}
Note: Required javax.servlet.jar and jdom.jar to execute ( downloadable from internet,add to classpath ).
5. SAMPLE CODE FOR PYTHON APPLICATION:
import http.client
conn = http.client.HTTPSConnection(“
headers = {
‘cache-control’: “no-cache”
}
conn.request(“GET”,”/V2/http-
res = conn.getresponse()
data = res.read()
print(data.decode(“utf-8”))
6. SAMPLE CODE FOR NODEJS APPLICATION:
var request = require (“request”);
var options = { method: ‘GET’,
url: ‘http://182.18.144.233/V2/
qs:
{
apikey: ‘xxxxxxxxxxxxxxxxxxxx’,
senderid: ‘xxxxxx’,
number: ‘xxxxxxxxxx’,
message: ‘hello’
},
strictSSL: false,
rejectUnauthorized: false,
headers:
{
‘cache-control’: ‘no-cache’ }
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
So the only difference between both, SMS API is only a String and Developers SMS API is a different developer’s languages API. Hope this description will help you to understand the Difference between SMS API and Developers SMS API, it’s also helps to get the different applications languages API to integrate your application with the SMS. Major purposes of the integration of API are:
– Two Factor Authentication
– One Time Password
– Customer Opt-in Subscription
– Auto Response Pulling
– Service Automation
– Application Trigger
– Software Communication
– Password Retrieval
– Service Reminder