https://www.smsidea.co.in/smsstatuswithid.aspx
Note:Error code for all type of response are listed at the end of this page.
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(); } }
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
<?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"); ?>
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) {} } }
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
https://www.smsidea.co.in/sms/api/msgdelete.aspx
https://www.smsidea.co.in/sms/api/getbalance.aspx
Note:Error code for string response are listed at the end of this page.
https://www.smsidea.co.in/sms/api/getvalidity.aspx
https://www.smsidea.co.in/sms/api/getdlttemplates.aspx
https://www.smsidea.co.in/sms/api/msgstatus.aspx
https://www.smsidea.co.in/sms/api/getmessageoutbox.aspx
https://www.smsidea.co.in/sms/api/getreport.aspx
https://www.smsidea.co.in/sms/api/getreportstatistic.aspx
https://www.smsidea.co.in/sendbulksms.aspx
Note: If you generate new API Key, The previous Api Key will no longer work. Do you want to continue?