A Powerful and easy-to-use platform for sending automated messages
Formatted SMS API Details :
Formatted SMS API Docuement :
SEND SMS through our Formatted SMS API : (Send SMS)
API to pass formatted json string : https://mshastra.com/sendsms_param.aspx
Parameters to Send Message :
SMS Template: Hi (1), your subscription will ends on (2).
To send a Formatted SMS to a group of mobiles numbers, each number’s variables must be defined, those variables will replacing (1) & (2),
in the SMS that will be sent to the each mobile number, and you can include those variables, in the parameter: msgKey, like this:
msgKey = (1) ,*, Akash ,@, (2) ,*, name2 ***
• (1), (2)…: the symbols where the values will be replaced with it.
• *: separate between the symbol and the value that will replace it.
• @: separate between each definition of the symbol and its value.
• ***: separate between each SMS definitions.
For Detailed example please refer our API document .
HTTP API Details :
Send SMS :
*smstype : 0 = Transactional-1,3 = Transactional Optin,4 = Promotional,13 = Transactional OTP,9 = Transactional-2
Check Balance :
ASP Code Sample : (Send SMS)
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://mshastra.com/sendurlcomma.aspx?”
strRequest = strRequest+”user=profileid”
strRequest = strRequest+”&pwd=pass”
strRequest = strRequest+”&senderid=senderid”
strRequest = strRequest+”&mobileno=”+strPh
strRequest = strRequest+”&msgtext=”+Server.URLEncode(strMsg)
strUrl = strUrl+strRequest
If msgResponse = “” Then
Dim oXML
Dim sPage
Err.Clear
On Error Resume Next
Set oXML = Server.CreateObject(“Msxml2.XMLHTTP”)
oXML.Open “get”, strUrl , false
oXML.Send
msgResponse = oXML.ResponseText
Set oXML = Nothing
End If
SMSSend = msgResponse
If Err.Number <> 0 Then
SMSSend = “Problem on sending sms : “& Err.Description
End If
End Function
ASP .NET (C#) Code Sample : (Send SMS)
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.IO;
using System.Net;
public void SMSSend()
{
WebClient client = new WebClient();
string baseurl = “http://mshastra.com/sendurlcomma.aspx?user=profileid&pwd=xxxx&senderid=ABC&CountryCode=91&mobileno=9911111111&msgtext=Hello”;
Stream data = client.OpenRead(baseurl);
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
data.Close();
reader.Close();
}
ASP .NET (VB.NET) Code Sample : (Send SMS)
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim strPh As String
Dim strMsg As String
Dim msgResponse
Dim msgRes As String
Dim strRequest As String
Dim strUrl
Dim server
strRequest = “”
msgResponse = “”
strPh = Trim(txtMoNumber.Text)
strMsg = Trim(txtMessage.Text)
strUrl = “http://mshastra.com/sendurl.aspx?”
strRequest = strRequest + “&user=200*****”
strRequest = strRequest + “&pwd=********”
strRequest = strRequest + “&senderid=ABCXYZ”
strRequest = strRequest + “&mobileno=” + strPh
strRequest = strRequest + “&msgtext=” + System.Uri.EscapeDataString(strMsg)
strRequest = strRequest + “&CountryCode=ALL”
strUrl = strUrl + strRequest
MsgBox(strUrl)
If msgResponse = “” Then
Dim oXML
Dim sPage
Err.Clear()
On Error Resume Next
oXML = CreateObject(“Msxml2.XMLHTTP”)
oXML.Open(“get”, strUrl, False)
oXML.Send()
msgResponse = oXML.ResponseText
msgRes = msgResponse
oXML = Nothing
MsgBox(msgRes)
End If
End Sub
End Class
Java Code Sample : (Send SMS)
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://mshastra.com/sendurlcomma.aspx?user=profileid&pwd=xxxx&senderid=ABC&CountryCode=91&mobileno=9911111111&msgtext=Hello);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod(“GET”);
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);
conn.connect();
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
StringBuffer buffer = new StringBuffer();
while ((line = rd.readLine()) != null)
{
buffer.append(line).append(“\n”);
}
System.out.println(buffer.toString());
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 ).
PHP Code Sample : (Send SMS)
‘– Use URLEncode for parameter msgtext
?php
$url = “http://mshastra.com/sendurlcomma.aspx?user=profileid&pwd=xxxx&senderid=ABC&CountryCode=91&mobileno=9911111111&msgtext=Hello”;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);
echo $curl_scraped_page;
?
Python Code Sample : (Send SMS)
import urllib3 # Python URL functions
from urllib.parse import quote_plus
http = urllib3.PoolManager()
user = “username” # Your username key.
pwd = “password” # Define password
senderid = “112233” # Sender ID,While using route4 sender id should be 6 characters long.
countrycode = “91” # country code.
mobileno = “9999999999” # mobile number
msgtext = “Test message” # Your message to send.
msgtext = quote_plus(msgtext) # URL encoding the data here.
# Prepare you post parameters
values = {
‘user’ : user,
‘pwd’ : pwd,
‘senderid’ : senderid,
‘CountryCode’ : countrycode,
‘mobileno’ : mobileno,
‘msgtext’ : msgtext
}
url = “http://mshastra.com/sendurl.aspx” # API URL
postdata = values
req = http.request(‘POST’,url, postdata)
print (req.data) # Print Response
JSON API Details :
JSON API Docuement :
SEND SMS through our JSON API : (Send SMS)
API to pass json string : https://mshastra.com/sendsms_api_json.aspx
Parameters to Send Message :
user = pwd = number =
msg =
sender =
language = <Unicode/English>
For Detailed example please refer our JSON API document .
ORACLE API Details :
ORACLE Docuement :
SEND SMS through our Oracle API’s : (Send SMS)
Sending SMS Requirements:
1. Oracle Database should be installed on the working machine.
2. Stable internet connection.
3. SMS account information (username, password), from our Website.
How to configure your file for sending SMS:
First of all, you should get the right version of API’s files that match the version of your oracle database, and we only support those versions of oracles: 6i & 7i & 9i & 10j
& 12c.
Configuration Steps:
1. Open folder Send_SMS, and build the required function your database.
2. When you need to work with forum, you need to install Oracle Developer that match the version of your database, and then you can run the GUI of our API’s.
Sending SMS Results:
1. Result (1): sending Completed Successfully.
2. Result (2): username is incorrect.
3. Result (3): password is incorrect.
4. Result (4): sender name is empty.
Send SMS :
WEB Services API Details :
Send SMS :
*smstype : 0 = Transactional one,3 = Transactional Optin,4 = Promotional,13 = Transactional OTP,9 = Transactional two,6=Transactional three
ASP.Net (C#) Code Sample : (Send SMS)
Step 1- Create a Web Site by File > New > Web Site > Asp.net Web Site
Step 2- Right-click Solution Explorer and choose “Add Web Reference”.
Paste the URL of the web service(http://mshastra.com/send_sms_web_service.asmx) and click on ‘Go’ button and then ‘Add reference’.
And give the namespace, here we give ‘SEND_SMS’
SEND_SMS.send_sms_web_service mys = new SEND_SMS.send_sms_web_service();// you need to create the object of the web service
string name = username.Text;
string pwd = password.Text;
string message = msg.Text;
string number = mobile.Text;
string sendername = senderid.Text;
string language = “”;
string country_code = “All”;
string api_key = “”;
string scheduled_date = “”;
string smstype = “”;
string param_1 = “”;
string param_2 = “”;
string param_3 = “”;
string result = mys.send_sms(name, pwd, sendername, number, message, country_code,api_key,scheduled_date,smstype,language,param_1,param_2,param_3);
lbl.Text = result;
ASP .NET (VB) Code Sample : (Send SMS)
‘This is done on visual studio
‘Just create a new project of vb on VS Studio
‘Right Click on Solution Exloprer of project and Selct Add Web Refernces
‘On popup box give url as ‘http://mshastra.com/send_sms_web_service.asmx’ on textbox and select GO
‘And give the namespace, here we give SEND_SMS’
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
‘create object to send_sms_web_service class, which is under namespace we given
Dim client As New SEND_SMS.send_sms_web_service ()
‘give the username,password,…..
‘method for sending text sms
MsgBox(client.send_sms(“name”, “pwd”, “sendername”, “number”, “message”, “country_code”,”api_key”,”scheduled_date”,”smstype”,”language”,”param_1″,”param_1″,”param_1″))
End Sub
End Class
Java Code Sample : (Send SMS)
/* This client program developed by using AXIS2 of Apache
* set the classpath to all jar files in LIB directory of AXIS2 api
* use ServiceStub class generated by WSDL2JAVA tool,set JAVA_HOME,AXIS2_HOME System variables
*/
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;
import org.apache.axis2.databinding.types.UnsignedLong ;
public class Client{
/* SETUP your SENDERID
*/
static String SID=”Your SENDERID”; //assign your senderid otherwise give empty string
public static void main(java.lang.String args[])throws Exception
{
ServiceStub stub =new ServiceStub();
/* Setup the proxy */
HttpTransportProperties.ProxyProperties proxyProperties = new HttpTransportProperties.ProxyProperties();
proxyProperties.setProxyName(“your PROXY”);
proxyProperties.setProxyPort(YOUR PORT NO);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(200*1000)); // give ur choice of number in Integer
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY, proxyProperties);
/* call the methods,while calling the methods
* you should set the setters in method definitions below like username,password,….
* and also enter message in hexa format for unicodesms,logo,picture,ringtone sms
*/
send_sms(stub);
} //end of main method
/* method for send Text SMS,Which internally interacts the SERVICESTUB class */
/* GIVE YOUR DETAILS */
public static void send_sms(ServiceStub stub)
{
try
{
“name”, “pwd”, “sendername”, “number”, “message”, “country_code”,”api_key”,”scheduled_date”,”smstype”,”language”,”param_1″,”param_1″,”param_1″
ServiceStub.send_sms sendmesg = new ServiceStub.send_sms();
sendmesg.setUsername(“USERNAME “);
sendmesg.setPassword(“PASSWORD “);
sendmesg.setSenderID(SID);
sendmesg.setMobilenumbers(“9199XXXXXXXX,91XXXXXXXXXX,….”);
sendmesg.setMessage(“TYPE YOUR MESSAGE”);
sendmesg.setCountryCode(“All”);
sendmesg.setApi_Key(“”);
sendmesg.setScheduled_Date(“”);
sendmesg.setSmsType(“”);
sendmesg.setLanguage(“”);
sendmesg.setParam_1(“”);
sendmesg.setParam_2(“”);
sendmesg.setParam_3(“”);
ServiceStub.SendTextSMSResponse response=stub.SendTextSMS(sendmesg);
System.out.println(response.getSendTextSMSResult());
}
catch(Exception e)
{
System.out.println(“this is from catch”);
e.printStackTrace();
}
}
XML API Details :
XML API Docuement :
SEND SMS through our XML API : (Send SMS)
API to pass XML string : https://mshastra.com/sendsms_api_xml.aspx
Parameters to Send Message :
user = pwd = number =
msg =
sender =
language = <Unicode/English>
For Detailed example please refer our XML API document .
VB6 Sample Code:
VB6 Sample
SMS from Excel :
Send SMS File Download
* Launch of New Version of SMS Studio (4.0).
Define Priority (High for quick delivery)
Character and SMS Count
Special Character support
* Check the SMS count before posting SMS.(Send 1 SMS to yourself and check the count deducted before posting the same SMS to many).
You need to download our Excel plugin software. This software will be plugged in your Excel as Add In. This software is free and once downloaded you can send SMS directly from Excel without the requirement of logging in. With this you can use various features of Excel while sending SMS.
Require .Net Framework 2.0. (Inbuilt in Vista). It can be downloaded from here