mVaayoo  
Home Home Contact Us Contact Us   mVaayoo mVaayoo  
mVaayoo
mVaayoo
mVaayoo              Sample Code »
mVaayoo SMS Gateway with APIs
mVaayoo
mVaayoo HTTP API
mVaayoo
mVaayoo SMPP API
mVaayoo
mVaayoo FTP API
mVaayoo
mVaayoo Unicode API
mVaayoo
mVaayoo
mVaayoo Features & Benefits
mVaayoo
mVaayoo Usage
mVaayoo
mVaayoo Case Study
mVaayoo
mVaayoo mVaayoo Advantage
mVaayoo
 
toll-free-18002666263
 
 
Sample Code  
 
1. .Net API with Sample Code
string strUrl =  "http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=
Username:Password&senderID=mVaayoo&receipientno=919849558211&msgtxt=This is a test from mVaayoo API&state=4"; 
WebRequest request = HttpWebRequest.Create(strUrl);
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(); 
Stream s = (Stream)response.GetResponseStream();
StreamReader readStream = new StreamReader( s );
string dataString = readStream.ReadToEnd();
response.Close();
s.Close();
readStream.Close();
 
2. ASP API Sample Code
@ ENABLESESSIONSTATE = False %>
<% option explicit %>
<% 

Dim objXMLHTTP, sRemoteURL,posturl //Create & initialize the XMLHTTP object 
Set objXMLHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP.6.0") 
sRemoteURL =  "http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=Username: Password&senderID=mVaayoo&receipientno=919849558211&msgtxt=
This is a test from mVaayoo API&state=4"; 

//Open the connection to the remote server 
objXMLHTTP.Open "POST", sRemoteURL 
//If you are behind proxy please mention the proxy ip with port. Or just comment below line...
objXMLHTTP.setProxy 2, "192.168.1.210:6666" 
objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
posturl = "User=xxxx&passwd=xxxx&mobilenumber=919xxxxxxxxx&message=xxxx&s
id=xxxx&mtype=N&DR=Y"
objXMLHTTP.setRequestHeader "Content-Length",LEN(posturl)
//Send the request to the eProcessingNetwork Transparent Database Engine
objXMLHTTP.Send posturl
//store the response
response.Write(objXMLHTTp.responseText)  %>

 
3. VB API with Sample Code
Dim strUrl As String
Dim strResp As String
strUrl = http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=Username: Password&senderID=mVaayoo&receipientno=
919849558211&msgtxt=This is a test from mVaayoo API&state=4
strResp = DoWebRequest(strUrl)
End Sub

'Do web Request Function
Public Function DoWebRequest(url) As String
On Error GoTo err_DoWebRequest
Dim objXML As Object
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET", url, False
objXML.Send
If (objXML.Status = 404) Then
DoWebRequest = "404 Error"
Else
DoWebRequest = objXML.ResponseText
End If
Set objXML = Nothing
Exit Function

err_DoWebRequest:
DoWebRequest = "ERROR"
Exit Function
End Function

 
4. PHP API with Sample Code
<?php 
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,  "http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=Username: Password&senderID=mVaayoo&receipientno=919849558211&msgtxt=
This is a test from mVaayoo API&state=4";
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&senderID=$sender
ID&receipientno=$receipientno&cid=$cid&msgtxt=$msgtxt");
$buffer = curl_exec($ch);
if(empty ($buffer))
{ echo " buffer is empty "; }
else
{ echo $buffer; } 
curl_close($ch);
?>