SMS API With Return MessageId

Request:

https://www.smsidea.co.in/smsstatuswithid.aspx


Parameters:

Field Description Required
mobile Your login username
pass Your Password/API Key
senderid Approved sender id (6 characters string only).
to Recipient Number (pass with comma seprated if need to send on more then one number)
msg Your sms content
peid Approved Principal Entity Id Associated with the senderid.
templateid dlt approved templateid.
msgtype uc (Compulsary only for unicode messaging)
scheduledate Schedule Time ex:(29-Dec-2010 11:45:52 AM) (Compulsary only for schedule messages)
restype xml/json(Optional, Default value: string)
A sample HTTP API Call for Single Recipient would be:
https://www.smsidea.co.in/smsstatuswithid.aspx?mobile=your_username&pass=your_password
&senderid=your_senderid&to=your_recipient1&msg=your_msg

A sample HTTP API Call for Unicode messaging would be:
https://www.smsidea.co.in/smsstatuswithid.aspx?mobile=your_username&pass=your_password
&senderid=your_senderid&to=your_recipient1,your_recipient2,your_recipient3
&msg=आपकासंदेश&msgtype=uc

XML Response Received after API Call would be:
<smsresponse>
<status>#status#</status>
<statusdesc>#statusdesc#</statusdesc>
<messageid>#messageid#</messageid>
</smsresponse>

JSON Response Received after API Call would be:
{"status":"#status#","statusdesc":"#statusdesc#","messageid":"#messageid#"}

String Response Received after API Call would be:
ResponseCode : ResponseMessage

Note:Error code for all type of response are listed at the end of this page.


Calling HTTP API Using C#.Net


using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Net;
public string SendSMS(){
Uri targetUri = new Uri(“https://www.smsidea.co.in/smsstatuswithid.aspx?mobile=your_username&pass=your
password&senderid=your_approved_senderid&to=to_number&msg=your_message”);
HttpWebRequest webRequest =
HttpWebRequest)System.Net.HttpWebRequest.Create(targetUri);
webRequest.Method = WebRequestMethods.Http.Get;
try
{
    string webResponse = string.Empty;
    using (HttpWebResponse getresponse =
    HttpWebResponse)webRequest.GetResponse())
    {
        using (StreamReader reader = new
        StreamReader(getresponse.GetResponseStream()))
    {
        webResponse = reader.ReadToEnd();
        reader.Close();
    }
    getresponse.Close();
    }
  return webResponse;
}
catch (System.Net.WebException ex)
{
    return "Request-Timeout";
}
catch (Exception ex)
{
    return "error";
}
finally{ webRequest.Abort(); }
}

Calling HTTP API Using VB.Net


Imports System.IO
Imports System.Net
Imports System.Data
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim WebRequest As Net.WebRequest 'object for WebRequest
Dim WebResonse As Net.WebResponse 'object for WebResponse
'Username that is to be used for submission
Dim UserName As String = ""
'password that is to be used along with username
Dim Password As String = ""
'Message content that is to be transmitted
Dim Message As String = "Test SMS"
'Url Encode message
Message = HttpUtility.UrlEncode(Message)
'Sender Id to be used for submitting the message
Dim SenderId As String = "Tester"
'Destinations to which message is to be sent For submitting more than one
destinations should be comma separated Like '91999000123,91999000124
Dim Destination As String = ""
'CODE COMPLETE TO DEFINE PARAMETER
Dim WebResponseString As String = ""
Dim URL As String = "https://www.smsidea.co.in/smsstatuswithid.aspx?mobile=" & UserName &
"&pass=" & Password & "&senderid=" &SenderId & "
&to=" & Destination & "&msg=" & Message & ""
WebRequest = Net.HttpWebRequest.Create(URL) 'Hit URL Link
WebRequest.Timeout = 25000
Try
WebResonse = WebRequest.GetResponse 'Get Response
Dim reader As IO.StreamReader = New
IO.StreamReader(WebResonse.GetResponseStream)
'Read Response and store in variable
WebResponseString = reader.ReadToEnd()
WebResonse.Close()
Response.Write(WebResponseString) 'Display Response.
Catch ex As Exception
WebResponseString = "Request Timeout" 'If any exception occur.
Response.Write(WebResponseString)
End Try
End Sub
End Class

Calling HTTP API Using php

<?php
class Sender{
public function Submit($username,$password,$senderid,$message,$mobile){
try{
//http Url to send sms.
$url="https://www.smsidea.co.in/smsstatuswithid.aspx";
$fields = array(
'mobile' => $username,
'pass' => $password,
'senderid' => $senderid,
'to' => $mobile,
'msg' => urlencode($message)
);
//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .=
$key.'='.$value.'&'; }
rtrim($fields_string, '&');
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
}
catch(Exception $e){
echo 'Message:' .$e->getMessage();
}
}
}
//Call The Constructor.
$obj = new Sender();
$obj->Submit ("","","Tester"," ,"Test SMS”, "919990001245");
?>                                                            

Calling HTTP API Using Java

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
/**
* An Example Class to use for the submission using HTTP API You can perform
* your own validations into this Class For username, password,destination,
* source, message
**/
public class Sender {
// Username that is to be used for submission
String username;
// password that is to be used along with username
String password;
// Message content that is to be transmitted
String message;
String destination;
// Sender Id to be used for submitting the message
String SenderId;
public Sender(String username, String password,String message, String
destination,String senderid) {
this.username = username;
this.password = password;
this.message = message;
this.destination = destination;
this.SenderId = senderid;
}
private void submitMessage() {
try {
// Url that will be called to submit the message
URL sendUrl = new URL("https://www.smsidea.co.in/smsstatuswithid.aspx");
HttpURLConnection httpConnection = (HttpURLConnection) sendUrl
.openConnection();
// This method sets the method type to POST so that will be send as a POST
request.
httpConnection.setRequestMethod("POST");
// This method is set as true wince we intend to send input to the server.
httpConnection.setDoInput(true);
// This method implies that we intend to receive data from server.
httpConnection.setDoOutput(true);
// Implies do not use cached data
httpConnection.setUseCaches(false);
// Data that will be sent over the stream to the server.
DataOutputStream dataStreamToServer = new DataOutputStream(
httpConnection.getOutputStream());
dataStreamToServer.writeBytes("mobile="
+ URLEncoder.encode(this.username, "UTF-8") + "&pass="
+ URLEncoder.encode(this.password, "UTF-8") + "&senderid="
+ URLEncoder.encode(this.SenderId, "UTF-8") + "&to="
+ URLEncoder.encode(this.destination, "UTF-8") + "&msg="
+ URLEncoder.encode(this.message, "UTF-8"));
dataStreamToServer.flush();
dataStreamToServer.close();
// Here take the output value of the server.
BufferedReader dataStreamFromUrl = new BufferedReader(
new InputStreamReader(httpConnection.getInputStream()));
String dataFromUrl = "", dataBuffer = "";
// Writing information from the stream to the buffer
while ((dataBuffer = dataStreamFromUrl.readLine()) != null) {
dataFromUrl += dataBuffer;
}
/**
* Now dataFromUrl variable contains the Response received from the
* server so we can parse the response and process it accordingly.
*/
dataStreamFromUrl.close();
System.out.println("Response: " + dataFromUrl);
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static void main(String[] args) {
try {
// Below example is for sending Plain text
Sender s = new Sender("xxxx",
"xxxx", "Test SMS", "440000xxx",
"tester");
s.submitMessage();
} catch (Exception ex) {}
}
}

Calling HTTP API Using VB 6

                                                            
Private Sub Form_Load()
Dim strUrl as string = "https://www.smsidea.co.in/smsstatuswithid.aspx?mobile=your
username&pass=your password&senderid=your approved senderid&to=to
number&msg=your message"
Dim objHttp as Object, strText as string
Set objHttp = CreateObject("MSXML2.ServerXMLHTTP")
objHttp.Open "GET", strUr, False
objHttp.setRequestHeader "User-Agent", _
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHttp.Send ("")
strText = objHttp.responseText
Set objHttp = Nothing
End Sub
Delete Message API

Request:

https://www.smsidea.co.in/sms/api/msgdelete.aspx


Parameters:

Field Description Required
mobile Your login username
pass Your login password / Your API Key
msgid MessageId
restype xml/json(Optional, Default value: json)
A sample HTTP API Call for delete message would be:
https://www.smsidea.co.in/sms/api/msgdelete.aspx?mobile=your_username&pass=your_password&msgid=MessageId

XML Response Received after API Call would be:
<response>
<status>#status#</status>
<statusdesc>#statusdesc#</statusdesc>
<data>#data#</data>
</response>

JSON Response Received after API Call would be:
{"status":"#status#","statusdesc":"#statusdesc#","data":"#data#"}

Note:Error code for all type of response are listed at the end of this page.

Get Balance API

Request:

https://www.smsidea.co.in/sms/api/getbalance.aspx


Parameters:

Field Description Required
mobile Your login username
pass Your login password
restype xml/json(Optional, Default value: string)
A sample HTTP API Call would be:
https://www.smsidea.co.in/sms/api/getbalance.aspx?mobile= your_username&pass=your_password

XML Response Received after API Call would be:
<balanceresponse>
<status>#status#</status>
<statusdesc>#statusdesc#</statusdesc>
<balance>#balance#</balance>
</balanceresponse>

JSON Response Received after API Call would be:
{"status":"#status#","statusdesc":"#statusdesc#","balance":"#balance#"}

String Response Received after API Call would be:
ResponseCode : ResponseMessage

Note:Error code for string response are listed at the end of this page.

Get Validity API

Request:

https://www.smsidea.co.in/sms/api/getvalidity.aspx


Parameters:

Field Description Required
mobile Your login username
pass Your login password
A sample HTTP API Call would be:
https://www.smsidea.co.in/sms/api/getvalidity.aspx?mobile= your_username&pass=your_password

Response Received after API Call would be:
ResponseCode : ResponseMessage

Note:Error code for string response are listed at the end of this page.

Get DLT Templates API

Request:

https://www.smsidea.co.in/sms/api/getdlttemplates.aspx


Parameters:

Field Description Required
mobile Your login username
pass Your login password / Your API Key
A sample HTTP API Call would be:
https://www.smsidea.co.in/sms/api/getdlttemplates.aspx?mobile=your_username&pass=your_password

XML Response Received after API Call would be:
<response>
<status>#status#</status>
<statusdesc>#statusdesc#</statusdesc>
<data>#data#</data>
</response>

JSON Response Received after API Call would be:
{"status":"#status#","statusdesc":"#statusdesc#","data":"#data#"}

Note:Error code for string response are listed at the end of this page.

Delivery Report API

Request:

https://www.smsidea.co.in/sms/api/msgstatus.aspx


Parameters:

Field Description Required
mobile Your login username
pass Your login password / Your API Key
msgtempid MessageId, this is the messageid you received at the time of send message api.
restype xml/json(Optional, Default value: json)
A sample HTTP API Call for Delivery Status would be:
https://www.smsidea.co.in/sms/api/msgstatus.aspx?mobile=your_username&pass=your_password&msgtempid=MsgId

XML Response Received after API Call would be:
<response>
<status>#status#</status>
<statusdesc>#statusdesc#</statusdesc>
<data>#data#</data>
</response>

JSON Response Received after API Call would be:
{"status":"#status#","statusdesc":"#statusdesc#","data":"#data#"}

Note:Error code for all type of response are listed at the end of this page.

Message Outbox API

Request:

https://www.smsidea.co.in/sms/api/getmessageoutbox.aspx


Parameters:

Field Description Required
mobile Your login username
pass Your login password / Your API Key
A sample HTTP API Call would be:
https://www.smsidea.co.in/sms/api/getmessageoutbox.aspx?mobile=your_username&pass=your_password

XML Response Received after API Call would be:
<response>
<status>#status#</status>
<statusdesc>#statusdesc#</statusdesc>
<data>#data#</data>
</response>

JSON Response Received after API Call would be:
{"status":"#status#","statusdesc":"#statusdesc#","data":"#data#"}

Note:Error code for string response are listed at the end of this page.

SMS Report API

Request:

https://www.smsidea.co.in/sms/api/getreport.aspx


Parameters:

Field Description Required
mobile Your login username
pass Your login password / Your API Key
senderid Approved sender id (6 characters string only).
fromdate From Date ex:(29-Dec-2010 11:45:52 AM)
todate To Date ex:(29-Dec-2010 11:45:52 AM)
restype xml/json(Optional, Default value: json)
A sample HTTP API Call for delete message would be:
https://www.smsidea.co.in/sms/api/getreport.aspx?mobile=your_mobilenumber&pass=password&senderid=senderid&fromdate=date&todate=date

XML Response Received after API Call would be:
<response>
<status>#status#</status>
<statusdesc>#statusdesc#</statusdesc>
<data>#data#</data>
</response>

JSON Response Received after API Call would be:
{"status":"#status#","statusdesc":"#statusdesc#","data":"#data#"}

Note:Error code for all type of response are listed at the end of this page.

SMS Report Statistic API

Request:

https://www.smsidea.co.in/sms/api/getreportstatistic.aspx


Parameters:

Field Description Required
mobile Your login username
pass Your login password / Your API Key
msgid MessageId
restype xml/json(Optional, Default value: json)
A sample HTTP API Call for Delivery Report Count would be:
https://www.smsidea.co.in/sms/api/getreportstatistic.aspx?mobile=9825589099&pass=password&msgid=msgid

XML Response Received after API Call would be:
<response>
<status>#status#</status>
<statusdesc>#statusdesc#</statusdesc>
<data>#data#</data>
</response>

JSON Response Received after API Call would be:
{"status":"#status#","statusdesc":"#statusdesc#","data":"#data#"}

Note:Error code for all type of response are listed at the end of this page.

Customized SMS API

Request:

https://www.smsidea.co.in/sendbulksms.aspx


Parameters:

Field Description Required
mobile Your login username
password Your login password / Your API Key
senderid Approved sender id (6 characters string only).
to Recipient Number (pass with comma seprated if need to send on more then one number)
text Actual Message to be sent
scheduledate Schedule Time ex:(29-Dec-2010 11:45:52 AM) (Compulsary only for schedule messages else left it blank)
msgtype uc (Compulsary only for unicode messaging else left it blank)
A sample HTTP API Call would be:
https://www.smsidea.co.in/sendbulksms.aspx?data={"mobile":9825589099,"password":"your password","senderid":"your senderid","msgtype":"","message":[{"text":"your msg 1","to":"1234567890","scheduledate":""},{"text":"your msg 2","to":"9898989898","scheduledate":""}]}

A sample HTTP API Call for Unicode messaging would be:
https://www.smsidea.co.in/sendbulksms.aspx?data={"mobile":9825589099,"password":"your password","senderid":"your senderid","msgtype":"uc","message":[{"text":"आपका संदेश 1","to":"1234567890","scheduledate":""},{"text":"आपका संदेश 2","to":"9898989898","scheduledate":""}]}

Response Received after API Call would be:
ResponseCode : ResponseMessage

Note:Error code for all type of response are listed at the end of this page.

Response Codes for API Call
Response Code Response Message
error API01 Invalid Username or Password.
error API03 Invalid senderid format.
error API04 You have not sufficiant balance.
error API06 Please enter 10 digit mobile number.
error API07 Error while sending SMS.
error API08 Please pass the required parameters.
error API10 Message length exceeded (Normal: Maximum 469 characters supported, Unicode: Maximum 800 characters supported).
error API11 Invalid schedule date format.
Response Code Response Message
000 success
001 invalid username or password
003 invalid senderid format
004 insufficient balance
006 invalid recepient number
007 miscellaneous error
008 missing required parameters