• Version: 1.9.3
  • Updated: 05/05/2021

Marsooly sms api

is a platform provides sms services such as otp for any type of verification , login with otp , two factor authentication , otp for registeration and others . You can access Marsooly sms api through registerd account and integrate your website , mobile app with Marsooly sms api easily using any programming language such as PHP,ASP.NET,C#,VB,JAVA ...etc

Warning !

Marsooly platform is not responsible for any deletion of messages after the sending process, and message cannot be restored if it was deleted via our own API. Please make sure that all API calls have validated values first.

Parameters

API request supports the following parameters.

api_token You can get this api token key after creating an account in Marsooly Platform (click here) for each application, and limit the usage of them by host IP Address.
Optional Parameters
format Format of the response. May be either json or string. If not provided, defaults to string.
Unicode ( optional) Unicode of the the message. Unicode parameter used for Arabic text but if not included then Marsooly encode the message if it is in Arabic language

Requests

Responses are, by default, sent in String format. However, this can be changed to JSON with the format parameter.

Every response will contain a "text" field, which can be either "success" or "failure". This field can be used to determine whether your request was successful.

Responses

All API requests should be sent to https://www.marsooly.com/api/{command}, where command is the API call you wish to execute, with the parameters included either in the POST Header or the URL (GET)..

Success Response

If the request done successfully , our API returns "success" in its response. These codes can be found in the text field.

                    
  1. [{
  2. "code":"200",
  3. "description":"The message has been sent successfully",
  4. "status":"success"
  5. }]

Failure Response

If there’s a problem with your request, our API may return "errors" in its response. These codes can be found in the text field.

                    
  1. [{
  2. "code":"201",
  3. "description":"Parameter [api_token] is missed",
  4. "status":"faliure"
  5. }]

Authenication

This funcion used to authenticate user in Marsooly sms api.

URL https://www.marsooly.com/api/Authentication.aspx
Parameters
api_token This filed for api token key registred in Marsooly sms api .

Sample Request Example

You can see all programming scripts for send message requests examples from here

<?php

function Authentication($api_token)
{

$url = 'https://www.marsooly.com/api/authentication.aspx?api_token=$api_token;

$ch =curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$api_token = "api_token here";
//Authentication
Authentication($api_token);
?>

<?php

function GetSenderNames($api_token)
{

$url = 'https://www.marsooly.com/api/GetSenderNames.aspx?api_token=$api_token;

$ch =curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$api_token = "api_token here";
//Get Sender Names
GetSenderNames($api_token);
?>

<?php

function GetBalance($username,$password)
{

$url = 'http://www.marsooly.com/api/users.aspx?code=7&username='$username&password=$password;

$ch =curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$username = "username here";
$password="********";
//Get Balance
GetBalance($username,$password);
?>

<?php

function send($username,$password,$mobile,$message,$sender)
{

$url = 'http://www.marsooly.com/api/httpSms.aspx?' . http_build_query(array(

'username' => $username ,
'password' => $password ,
'mobile' => $mobile ,
'message' => $message ,
'sender' => $sender
)) ;

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$username = "username here";
$mobile="96655xxxxxxx";
$password="********";
$message="تجربة ارسال";
$senderName="sender name here";
//send sms
send($username,$password,$mobile,$message,$sender);
?>

/*Authentication Api */

public string Authentication(string api_token)
{

string auth_url="https://www.marsooly.com/api/authentication.aspx?api_token="+api_token;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Senders Names Api */

public string GetSenderNames(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Balance Api */

public string GetBalance(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=7&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*send message Api */

public string sendmessage(string user_name, string pass, string mobile, string message, string sendername)
{

string _url="https://www.marsooly.com/api/httpSms.aspx?
string _param;
_param="username="+user_name+"&password="+pass+"&mobile="+mobile+"&message="+message+"&sender="+sendername;
string send_url;
send_url=_url + _param ;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( send_url ) ;
request.Method = "POST";
var data = Encoding.UTF8.GetBytes(send_url);
request.ContentLength = data.Length;
var streamwritter = request.GetRequestStream();
streamwritter.Write(data, 0, data.Length);
streamwritter.Close();

var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

'Authentication Api

Public Function Authentication ( ByVal api_token As String) As String

Dim auth_url As String = "https://www.marsooly.com/api/authentication.aspx?api_token=api_token
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Get Sender Names Api

Public Function getSenderNames ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'get Balance Api

Public Function getBalance ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=7&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Send Message Api

Public Function SendMessage ( ByVal user_name As String , ByVal user_name As String , ByVal mobile As String , ByVal message As String , ByVal sendername As String ) As String

Dim postData As String = ""
postData=username="+user_name+"&password="+pass +"&mobile="+mobile+"&message="+message+"&sender="+sendername
Dim send_url As String = "https://www.marsooly.com/api/users.aspx
Dim result As String = ""
Try

Dim encoding As UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim request As HttpWebRequest = DirectCast(WebRequest.Create(send_url), HttpWebRequest )
request.Method = "POST"
request.KeepAlive = True
request.ContentLength = byteData.Length
request.ContentType = "application/x-www-form-urlencoded"
Dim postreqstream As Stream = request.GetRequestStream ()
postreqstream.Write(byteData , 0 , byteData.Length )
postreqstream.Close ()
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

<%
	api_token = "api_token"
   
    link = "https://www.marsooly.com/api/authentication.aspx?"
	url = link & "api_token=" & api_token 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>
<%
	api_token = "your api_token here"
    
    link = "https://www.marsooly.com/api/GetSenderNames.aspx?"
	url = link & "username=" & username & "&password=" & password & "&code=" & code 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>
<%
	username = "your username"
    password = "your password"
	
    link = "http://www.marsooly.com/api/users.aspx?"
	code = 7 
	url = link & "username=" & username & "&password=" & password & "&code=" & code 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>
<%
	username = "your username"
    password = "your password"
	
    link = "http://www.marsooly.com/api/httpSms.aspx?"
	message = "your message"
	message = Server.urlencode(message)
	mobile = "9665xxxxxxxx1,9665xxxxxxxx2"
	sender = "your sender name"
	url = link & "username=" & username & "&password=" & password & "&mobile=" & mobile & "&message=" & message & "&sender=" & sender 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>

/*Authentication Api */

public string Authentication(string api_token)
{

string auth_url="https://www.marsooly.com/api/authentication.aspx?api_token=api_token;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Senders Names Api */

public string GetSenderNames(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Balance Api */

public string GetBalance(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=7&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*send message Api */

public string sendmessage(string user_name, string pass, string mobile, string message, string sendername)
{

string _url="https://www.marsooly.com/api/httpSms.aspx?
string _param;
_param="username="+user_name+"&password="+pass+"&mobile="+mobile+"&message="+message+"&sender="+sendername;
string send_url;
send_url=_url + _param ;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( send_url ) ;
request.Method = "POST";
var data = Encoding.UTF8.GetBytes(send_url);
request.ContentLength = data.Length;
var streamwritter = request.GetRequestStream();
streamwritter.Write(data, 0, data.Length);
streamwritter.Close();

var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

'Authentication Api

Public Function Authentication ( ByVal api_token As String) As String

Dim auth_url As String = "https://www.marsooly.com/api/authentication.aspx?api_token="+api_token
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Get Sender Names Api

Public Function getSenderNames ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'get Balance Api

Public Function getBalance ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=7&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Send Message Api

Public Function SendMessage ( ByVal user_name As String , ByVal user_name As String , ByVal mobile As String , ByVal message As String , ByVal sendername As String ) As String

Dim postData As String = ""
postData=username="+user_name+"&password="+pass +"&mobile="+mobile+"&message="+message+"&sender="+sendername
Dim send_url As String = "https://www.marsooly.com/api/users.aspx
Dim result As String = ""
Try

Dim encoding As UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim request As HttpWebRequest = DirectCast(WebRequest.Create(send_url), HttpWebRequest )
request.Method = "POST"
request.KeepAlive = True
request.ContentLength = byteData.Length
request.ContentType = "application/x-www-form-urlencoded"
Dim postreqstream As Stream = request.GetRequestStream ()
postreqstream.Write(byteData , 0 , byteData.Length )
postreqstream.Close ()
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

Public Sub Authentication()
	Dim api_token As String
	Dim result As String
	Dim myURL As String
	Dim postData As String
	Dim winHttpReq As Object
	api_token = "your api_token"
	
 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/authentication.aspx?"
	postData = "api_token=" + api_token 
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	Authentication = winHttpReq.responseText
End Sub
Public Sub GetSenderNames()
	Dim api_token As String
	Dim result As String
	Dim myURL As String
	Dim postData As String
	Dim winHttpReq As Object
	username = "your username"
	password = "your password"

 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/users.aspx?"
	postData = "username=" + username + "&password=" + password + "&code=" + code 
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	GetSenderNames = winHttpReq.responseText
End Sub
Public Sub GetBalance()
	Dim username As String
	Dim password As String
	Dim result As String
	Dim myURL As String
	Dim code As String =7
	Dim postData As String
	Dim winHttpReq As Object
	username = "your username"
	password = "your password"

 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/users.aspx?"
	postData = "username=" + username + "&password=" + password + "&code=" + code 
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	GetBalance = winHttpReq.responseText
End Sub
Public Sub SendMessage()
	Dim username As String
	Dim password As String
	Dim mobile As String
	Dim message As String
	Dim sender As String
	Dim result As String
	Dim myURL As String
	Dim postData As String
	Dim winHttpReq As Object
	username = "your username"
	password = "your password"
    mobile = "9665xxxxxxxx1,9665xxxxxxxx2"
    message = "your message"
    sender = "your sender name"

 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/httpSms.aspx?"
	postData = "username=" + username + "&password=" + password"&mobile=" + mobile"&message=" + message"&sender=" + sender
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	result = winHttpReq.responseText
End Sub
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String Authentication() {
		try {
			
            // Construct data
			String api_token = "api_token=" + "your api_token";
            

			// Authentication data
			HttpURLConnection conn =(HttpURLConnection)new URL("https://www.marsooly.com/api/authentication.aspx?").openConnection();
			String data = api_token ;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String GetSenderNames() {
		try {
			
            // Construct data
			String username = "username=" + "your username";
            String password = "&password=" + "your password";
			String code = "&code=8";
			

			// get senders names data
			HttpURLConnection conn = (HttpURLConnection) new URL("https://www.marsooly.com/api/users.aspx?").openConnection();
			String data = username + password + code ;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String GetBalance() {
		try {
			
            // Construct data
			String username = "username=" + "your username";
            String password = "&password=" + "your password";
			String code = "&code=7";
			

			// get sms credit data
			HttpURLConnection conn = (HttpURLConnection) new URL("https://www.marsooly.com/api/users.aspx?").openConnection();
			String data = username + password + code ;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String SendMessage() {
		try {
			
            // Construct data
			String username = "username=" + "your username";
            String password = "&password=" + "your password";
			String message = "&message=" + "here is your message";
			String sender = "&sender=" + "sender name here";
			String mobile = "&mobile=" + "9665xxxxxxxx1,9665xxxxxxxx2";


			// Send data
			HttpURLConnection conn = (HttpURLConnection) new URL("https://www.marsooly.com/api/httpSms.aspx?").openConnection();
			String data = username + password + mobile + message + sender;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}

    
	Dim  api_token  As String = "your api_token"
   Dim  link  As String = "https://www.marsooly.com/api/authentication.aspx?"
	Dim  url  As String =  link & "api_token=" & api_token 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    

    
	Dim  username  As String = "your username"
    Dim  password  As String = "your password"
	Dim  code  As String = "8"
	Dim  link  As String = "http://www.marsooly.com/api/users.aspx?"
	Dim  url  As String =  link & "username=" & username & "&password=" & password & "&code=" & code 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    

    
	Dim  username  As String = "your username"
    Dim  password  As String = "your password"
	Dim  code  As String = "7"
	Dim  link  As String = "http://www.marsooly.com/api/users.aspx?"
	Dim  url  As String =  link & "username=" & username & "&password=" & password & "&code=" & code 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    

    
	Dim  username  As String = "your username"
    Dim  password  As String = "your password"
	Dim  message  As String = "your message here"
	Dim  mobile  As String = "9665xxxxxxxx1,9665xxxxxxxx2"
	Dim  sender  As String = "your sender name here"
	Dim  link  As String = "http://www.marsooly.com/api/httpSms.aspx?"
	Dim  url  As String =  link & "username=" & username & "&password=" & password & "&message=" & message "&mobile=" & mobile "&sender=" & sender 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    
#!/usr/bin/env python

import urllib.request
import urllib.parse

def Authentication(api_token):
    data =  urllib.parse.urlencode({'api_token': api_token})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api.authentication.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  Authentication('api_token')
print (resp)
#!/usr/bin/env python

import urllib.request
import urllib.parse

def GetSenderNames(username, password, code):
    data =  urllib.parse.urlencode({'username': username, 'password': password,'code' : code})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api.users.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  GetSenderNames('username', '**********','8')
print (resp)
#!/usr/bin/env python

import urllib.request
import urllib.parse

def GetBalance(username, password, code):
    data =  urllib.parse.urlencode({'username': username, 'password': password,'code' : code})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api.users.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  GetBalance('username', '**********','7')
print (resp)
#!/usr/bin/env python

import urllib.request
import urllib.parse

def SendMessage(username, password, message, mobile, sender):
    data =  urllib.parse.urlencode({'username': username, 'password': password,'message' : message, 'mobile': mobile, 'sender': sender})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api.httpSms.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  SendMessage('username', '**********','your message here', '9665xxxxxxx1,9665xxxxxxx2', 'yuor sender name here')
print (resp)
function Authentication(api_token):string;
    const URL = 'https://www.marsooly.com/api/authentication.aspx?api_token=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[api_token]); 
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
function GetSenderNames(username, password, Sender, mobile,Message: String):string;
    const URL = 'https://www.marsooly.com/api/users.aspx?code=8&username=%s&password=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[username,password]); 
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
function GetBalance(username, password, Sender, mobile,Message: String):string;
    const URL = 'https://www.marsooly.com/api/users.aspx?code=7&username=%s&password=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[username,password]); 
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
function SendSMS(username, password, Sender, mobile,Message: String):string;
    const URL = 'https://www.marsooly.com/api/httpSms.aspx?username=%s&password=%s&sender=%s&mobile=%s&message=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[username,password,Sender,mobile,HttpEncode(Message)]);
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $api_token = 'your api_token'; 
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/authentication.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'api_token'	=> $api_token]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $code = "8";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/users.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'code'	=> $code
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $code = "7";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/users.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'code'	=> $code
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $sender = "your sender name";
my $mobile = "9665xxxxxxxx,9665xxxxxxxx";
my $message = "here is your message";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/httpSms.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'mobile'	=> $mobile,
		'message'	=> $message,
		'sender'	=> $sender
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/authentication.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'api_token' => 'your api_token')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/users.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'code' => '8')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/users.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'code' => '7')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/httpSms.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'message' => 'here is your message', 'sender' => 'your sender name', 'mobile' => '9665xxxxxxxx,9665xxxxxxxx')
response = JSON.parse(res.body)
puts (response)

Sample Response Example

Success Codes
100 user token is authenticated successfully
Failure Codes
101 Parameter [api_token] is missed
102 Api token is inactive
103 Api token is incorrect
104 unknown data
105 runtime error exception

SendSMS

This funcion used to send text messages to either individual numbers or entire contact groups .

URL https://www.marsooly.com/api/SendMessage.aspx
Parameters
api_token This filed for api token key registred in Marsooly sms api .
message The message content. This parameter should be no longer than 765 characters .
mobile The mobile content. This parameter should be no longer than 12 digits and should be started with country code such 9665xxxxxxxx,9665xxxxxxxx .
sender title of the the message. sender parameter used for title of the message and should be no longer than 11 characters
unicode Unicode of the the message. Unicode parameter used for Arabic text but if not included then Marsooly encode the message if it is in Arabic language . U value for Arabic and unicode text message , E value used for english text message
date ( optional) Date of the the message . date parameter used for schedueling the date of send process
time (optional)Time of the the message . time parameter used for schedueling the time of send process

Sample Request Example

You can see all programming scripts for send message requests examples from here

<?php

function Authentication($username,$password)
{

$url = 'http://www.marsooly.com/api/users.aspx?code=1&username=$username&password=$password;

$ch =curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$username = "username here";
$password="********";
//Authentication
Authentication($username,$password);
?>

<?php

function GetSenderNames($username,$password)
{

$url = 'http://www.marsooly.com/api/users.aspx?code=8&username='$username&password=$password;

$ch =curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$username = "username here";
$password="********";
//Get Sender Names
GetSenderNames($username,$password);
?>

<?php

function GetBalance($username,$password)
{

$url = 'http://www.marsooly.com/api/users.aspx?code=7&username='$username&password=$password;

$ch =curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$username = "username here";
$password="********";
//Get Balance
GetBalance($username,$password);
?>

<?php

function send($api_token,$mobile,$message,$sender)
{

$url = 'https://www.marsooly.com/api/SendMessage.aspx?' . http_build_query(array(

'api_token' => $api_token ,

'mobile' => $mobile ,
'message' => $message ,
'sender' => $sender
)) ;

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$username = "api_token here";
$mobile="96655xxxxxxx";
$message="تجربة ارسال";
$senderName="sender name here";
//send sms
send($api_token,$mobile,$message,$sender);
?>

/*Authentication Api */

public string Authentication(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=1&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Senders Names Api */

public string GetSenderNames(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Balance Api */

public string GetBalance(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=7&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*send message Api */

public string sendmessage(string api_token, string mobile, string message, string sendername)
{

string _url="https://www.marsooly.com/api/SendMessage.aspx?
string _param;
_param="api_token="+api_token+"&mobile="+mobile+"&message="+message+"&sender="+sendername;
string send_url;
send_url=_url + _param ;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( send_url ) ;
request.Method = "POST";
var data = Encoding.UTF8.GetBytes(send_url);
request.ContentLength = data.Length;
var streamwritter = request.GetRequestStream();
streamwritter.Write(data, 0, data.Length);
streamwritter.Close();

var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

'Authentication Api

Public Function Authentication ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=1&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Get Sender Names Api

Public Function getSenderNames ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'get Balance Api

Public Function getBalance ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=7&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Send Message Api

Public Function SendMessage ( ByVal api_token As String, ByVal mobile As String , ByVal message As String , ByVal sendername As String ) As String

Dim postData As String = ""
postData=api_token="+api_token +"&mobile="+mobile+"&message="+message+"&sender="+sendername
Dim send_url As String = "https://www.marsooly.com/api/SendMessage.aspx
Dim result As String = ""
Try

Dim encoding As UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim request As HttpWebRequest = DirectCast(WebRequest.Create(send_url), HttpWebRequest )
request.Method = "POST"
request.KeepAlive = True
request.ContentLength = byteData.Length
request.ContentType = "application/x-www-form-urlencoded"
Dim postreqstream As Stream = request.GetRequestStream ()
postreqstream.Write(byteData , 0 , byteData.Length )
postreqstream.Close ()
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

<%
	username = "your username"
    password = "your password"
	
    link = "http://www.marsooly.com/api/users.aspx?"
	code = 1 
	url = link & "username=" & username & "&password=" & password & "&code=" & code 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>
<%
	username = "your username"
    password = "your password"
	
    link = "http://www.marsooly.com/api/users.aspx?"
	code = 8 
	url = link & "username=" & username & "&password=" & password & "&code=" & code 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>
<%
	username = "your username"
    password = "your password"
	
    link = "http://www.marsooly.com/api/users.aspx?"
	code = 7 
	url = link & "username=" & username & "&password=" & password & "&code=" & code 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>
<%
	api_token = "your api_token"
   
    link = "https://www.marsooly.com/api/SendMessage.aspx?"
	message = "your message"
	message = Server.urlencode(message)
	mobile = "9665xxxxxxxx1,9665xxxxxxxx2"
	sender = "your sender name"
	url = link & "api_token=" & api_token & "&mobile=" & mobile & "&message=" & message & "&sender=" & sender 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>

/*Authentication Api */

public string Authentication(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=1&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Senders Names Api */

public string GetSenderNames(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Balance Api */

public string GetBalance(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=7&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*send message Api */

public string sendmessage(string api_token, string mobile, string message, string sendername)
{

string _url="https://www.marsooly.com/api/SendMessage.aspx?
string _param;
_param="api_token="+api_token+"&mobile="+mobile+"&message="+message+"&sender="+sendername;
string send_url;
send_url=_url + _param ;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( send_url ) ;
request.Method = "POST";
var data = Encoding.UTF8.GetBytes(send_url);
request.ContentLength = data.Length;
var streamwritter = request.GetRequestStream();
streamwritter.Write(data, 0, data.Length);
streamwritter.Close();

var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

'Authentication Api

Public Function Authentication ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=1&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Get Sender Names Api

Public Function getSenderNames ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'get Balance Api

Public Function getBalance ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=7&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Send Message Api

Public Function SendMessage ( ByVal api_token As String, ByVal mobile As String , ByVal message As String , ByVal sendername As String ) As String

Dim postData As String = ""
postData=username="+api_token+"&mobile="+mobile+"&message="+message+"&sender="+sendername
Dim send_url As String = "https://www.marsooly.com/api/SendMessage.aspx
Dim result As String = ""
Try

Dim encoding As UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim request As HttpWebRequest = DirectCast(WebRequest.Create(send_url), HttpWebRequest )
request.Method = "POST"
request.KeepAlive = True
request.ContentLength = byteData.Length
request.ContentType = "application/x-www-form-urlencoded"
Dim postreqstream As Stream = request.GetRequestStream ()
postreqstream.Write(byteData , 0 , byteData.Length )
postreqstream.Close ()
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

Public Sub Authentication()
	Dim api_token As String
	Dim result As String
	Dim myURL As String
	Dim code As String =1
	Dim postData As String
	Dim winHttpReq As Object
	username = "your username"
	password = "your password"

 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/users.aspx?"
	postData = "username=" + username + "&password=" + password + "&code=" + code 
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	Authentication = winHttpReq.responseText
End Sub
Public Sub GetSenderNames()
	Dim username As String
	Dim password As String
	Dim result As String
	Dim myURL As String
	Dim code As String =8
	Dim postData As String
	Dim winHttpReq As Object
	username = "your username"
	password = "your password"

 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/users.aspx?"
	postData = "username=" + username + "&password=" + password + "&code=" + code 
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	GetSenderNames = winHttpReq.responseText
End Sub
Public Sub GetBalance()
	Dim username As String
	Dim password As String
	Dim result As String
	Dim myURL As String
	Dim code As String =7
	Dim postData As String
	Dim winHttpReq As Object
	username = "your username"
	password = "your password"

 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/users.aspx?"
	postData = "username=" + username + "&password=" + password + "&code=" + code 
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	GetBalance = winHttpReq.responseText
End Sub
Public Sub SendMessage()
	Dim api_token As String
	Dim mobile As String
	Dim message As String
	Dim sender As String
	Dim result As String
	Dim myURL As String
	Dim postData As String
	Dim winHttpReq As Object
	api_token = "your api_token"
	mobile = "9665xxxxxxxx1,9665xxxxxxxx2"
    message = "your message"
    sender = "your sender name"

 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/SendMessage.aspx?"
	postData = "api_token=" + api_token + "&mobile=" + mobile"&message=" + message"&sender=" + sender
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	result = winHttpReq.responseText
End Sub
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String Authentication() {
		try {
			
            // Construct data
			String username = "username=" + "your username";
            String password = "&password=" + "your password";
			String code = "&code=1";
			

			// Authentication data
			HttpURLConnection conn =(HttpURLConnection)new URL("https://www.marsooly.com/api/users.aspx?").openConnection();
			String data = username + password + code ;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String GetSenderNames() {
		try {
			
            // Construct data
			String username = "username=" + "your username";
            String password = "&password=" + "your password";
			String code = "&code=8";
			

			// get senders names data
			HttpURLConnection conn = (HttpURLConnection) new URL("https://www.marsooly.com/api/users.aspx?").openConnection();
			String data = username + password + code ;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String GetBalance() {
		try {
			
            // Construct data
			String username = "username=" + "your username";
            String password = "&password=" + "your password";
			String code = "&code=7";
			

			// get sms credit data
			HttpURLConnection conn = (HttpURLConnection) new URL("https://www.marsooly.com/api/users.aspx?").openConnection();
			String data = username + password + code ;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String SendMessage() {
		try {
			
            // Construct data
			String api_token = "api_token=" + "your username";
            String message = "&message=" + "here is your message";
			String sender = "&sender=" + "sender name here";
			String mobile = "&mobile=" + "9665xxxxxxxx1,9665xxxxxxxx2";


			// Send data
			HttpURLConnection conn = (HttpURLConnection) new URL("https://www.marsooly.com/api/SendMessage.aspx?").openConnection();
			String data = api_token + mobile + message + sender;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}

    
	Dim  username  As String = "your username"
    Dim  password  As String = "your password"
	Dim  code  As String = "1"
	Dim  link  As String = "http://www.marsooly.com/api/users.aspx?"
	Dim  url  As String =  link & "username=" & username & "&password=" & password & "&code=" & code 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    

    
	Dim  username  As String = "your username"
    Dim  password  As String = "your password"
	Dim  code  As String = "8"
	Dim  link  As String = "http://www.marsooly.com/api/users.aspx?"
	Dim  url  As String =  link & "username=" & username & "&password=" & password & "&code=" & code 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    

    
	Dim  username  As String = "your username"
    Dim  password  As String = "your password"
	Dim  code  As String = "7"
	Dim  link  As String = "http://www.marsooly.com/api/users.aspx?"
	Dim  url  As String =  link & "username=" & username & "&password=" & password & "&code=" & code 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    

    
	Dim  api_token  As String = "your api_token"
	Dim  message  As String = "your message here"
	Dim  mobile  As String = "9665xxxxxxxx1,9665xxxxxxxx2"
	Dim  sender  As String = "your sender name here"
	Dim  link  As String = "https://www.marsooly.com/api/SendMessage.aspx?"
	Dim  url  As String =  link & "api_token=" & api_token & "&message=" & message "&mobile=" & mobile "&sender=" & sender 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    
#!/usr/bin/env python

import urllib.request
import urllib.parse

def Authentication(username, password, code):
    data =  urllib.parse.urlencode({'username': username, 'password': password,'code' : code})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api.users.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  Authentication('username', '***********','1')
print (resp)
#!/usr/bin/env python

import urllib.request
import urllib.parse

def GetSenderNames(username, password, code):
    data =  urllib.parse.urlencode({'username': username, 'password': password,'code' : code})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api.users.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  GetSenderNames('username', '**********','8')
print (resp)
#!/usr/bin/env python

import urllib.request
import urllib.parse

def GetBalance(username, password, code):
    data =  urllib.parse.urlencode({'username': username, 'password': password,'code' : code})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api.users.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  GetBalance('username', '**********','7')
print (resp)
#!/usr/bin/env python

import urllib.request
import urllib.parse

def SendMessage(api_token, message, mobile, sender):
    data =  urllib.parse.urlencode({'api_token': api_token,'message' : message, 'mobile': mobile, 'sender': sender})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api/SendMessage.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  SendMessage('api_token','your message here', '9665xxxxxxx1,9665xxxxxxx2', 'yuor sender name here')
print (resp)
function Authentication(username, password, Sender, mobile,Message: String):string;
    const URL = 'https://www.marsooly.com/api/users.aspx?code=1&username=%s&password=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[username,password]); 
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
function GetSenderNames(username, password, Sender, mobile,Message: String):string;
    const URL = 'https://www.marsooly.com/api/users.aspx?code=8&username=%s&password=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[username,password]); 
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
function GetBalance(username, password, Sender, mobile,Message: String):string;
    const URL = 'https://www.marsooly.com/api/users.aspx?code=7&username=%s&password=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[username,password]); 
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
function SendSMS(api_token, Sender, mobile,Message: String):string;
    const URL = 'https://www.marsooly.com/api/SendMessage.aspx?api_token=%s&sender=%s&mobile=%s&message=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[api_token,Sender,mobile,HttpEncode(Message)]);
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $code = "1";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/users.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'code'	=> $code
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $code = "8";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/users.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'code'	=> $code
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $code = "7";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/users.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'code'	=> $code
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $api_token = 'your api_token'; 
my $sender = "your sender name";
my $mobile = "9665xxxxxxxx,9665xxxxxxxx";
my $message = "here is your message";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/SendMessage.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'api_token'	=> $api_token,
		'mobile'	=> $mobile,
		'message'	=> $message,
		'sender'	=> $sender
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/users.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'code' => '1')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/users.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'code' => '8')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/users.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'code' => '7')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/SendMessage.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'api_token' => 'your api_token' => 'message' => 'here is your message', 'sender' => 'your sender name', 'mobile' => '9665xxxxxxxx,9665xxxxxxxx')
response = JSON.parse(res.body)
puts (response)

Sample Response Example

Success Codes
200 The message has been sent successfully
Failure Codes
201 Parameter [parameter name] is missed
202 Api token is inactive
203 Api token is incorrect
204 unknown data
205 Response contains error
206 sms credit balance is not enough to send this message
207 Sender Name is not Active
208 Invalid mobile values
209 Invalid parameters values
210 No message content.
211 Message too long.
212 You have supplied too many mobile numbers.
213 invalid sender name content.
214 the account is not active

Get SMS Credit Balance

This api used to get current sms balance .

URL https://www.marsooly.com/api/GetSMSCredit.aspx
Parameters
api_token This filed for api token key registred in Marsooly sms api .

Sample Request Example

You can see all programming scripts for send message requests examples from here

<?php

function GetBalanace($api_token)
{

$url = 'https://www.marsooly.com/api/GetSMSCredit.aspx?api_token=$api_token;

$ch =curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$api_token = "api_token here";
//Get Balanace
GetBalanace($api_token);
?>

<?php

function Authentication($username,$password)
{

$url = 'http://www.marsooly.com/api/users.aspx?code=1&username=$username&password=$password;

$ch =curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$username = "username here";
$password="********";
//Authentication
Authentication($username,$password);
?>

<?php

function GetSenderNames($username,$password)
{

$url = 'http://www.marsooly.com/api/users.aspx?code=8&username='$username&password=$password;

$ch =curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$username = "username here";
$password="********";
//Get Sender Names
GetSenderNames($username,$password);
?>

<?php

function send($username,$password,$mobile,$message,$sender)
{

$url = 'http://www.marsooly.com/api/httpSms.aspx?' . http_build_query(array(

'username' => $username ,
'password' => $password ,
'mobile' => $mobile ,
'message' => $message ,
'sender' => $sender
)) ;

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$username = "username here";
$mobile="96655xxxxxxx";
$password="********";
$message="تجربة ارسال";
$senderName="sender name here";
//send sms
send($username,$password,$mobile,$message,$sender);
?>

/*Get Balance Api */

public string GetBalance(string api_token)
{

string auth_url="https://www.marsooly.com/api/GetSMSCredit.aspx?api_token="+api_token;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Authentication Api */

public string Authentication(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=1&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Senders Names Api */

public string GetSenderNames(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*send message Api */

public string sendmessage(string user_name, string pass, string mobile, string message, string sendername)
{

string _url="https://www.marsooly.com/api/httpSms.aspx?
string _param;
_param="username="+user_name+"&password="+pass+"&mobile="+mobile+"&message="+message+"&sender="+sendername;
string send_url;
send_url=_url + _param ;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( send_url ) ;
request.Method = "POST";
var data = Encoding.UTF8.GetBytes(send_url);
request.ContentLength = data.Length;
var streamwritter = request.GetRequestStream();
streamwritter.Write(data, 0, data.Length);
streamwritter.Close();

var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

'Get Balance Api

Public Function GetBalance ( ByVal api_token As String) As String

Dim auth_url As String = "https://www.marsooly.com/api/GetSMSCredit.aspx?api_token=api_token
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Authentication Api

Public Function Authentication ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=1&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Get Sender Names Api

Public Function getSenderNames ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Send Message Api

Public Function SendMessage ( ByVal user_name As String , ByVal user_name As String , ByVal mobile As String , ByVal message As String , ByVal sendername As String ) As String

Dim postData As String = ""
postData=username="+user_name+"&password="+pass +"&mobile="+mobile+"&message="+message+"&sender="+sendername
Dim send_url As String = "https://www.marsooly.com/api/users.aspx
Dim result As String = ""
Try

Dim encoding As UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim request As HttpWebRequest = DirectCast(WebRequest.Create(send_url), HttpWebRequest )
request.Method = "POST"
request.KeepAlive = True
request.ContentLength = byteData.Length
request.ContentType = "application/x-www-form-urlencoded"
Dim postreqstream As Stream = request.GetRequestStream ()
postreqstream.Write(byteData , 0 , byteData.Length )
postreqstream.Close ()
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

<%
	api_token = "api_token"
   
    link = "https://www.marsooly.com/api/GetSMSCredit.aspx?"
	url = link & "api_token=" & api_token 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>
<%
	username = "your username"
    password = "your password"
	
    link = "http://www.marsooly.com/api/users.aspx?"
	code = 1 
	url = link & "username=" & username & "&password=" & password & "&code=" & code 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>
<%
	username = "your username"
    password = "your password"
	
    link = "http://www.marsooly.com/api/users.aspx?"
	code = 8 
	url = link & "username=" & username & "&password=" & password & "&code=" & code 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>
<%
	username = "your username"
    password = "your password"
	
    link = "http://www.marsooly.com/api/httpSms.aspx?"
	message = "your message"
	message = Server.urlencode(message)
	mobile = "9665xxxxxxxx1,9665xxxxxxxx2"
	sender = "your sender name"
	url = link & "username=" & username & "&password=" & password & "&mobile=" & mobile & "&message=" & message & "&sender=" & sender 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>

/*Authentication Api */

public string Authentication(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=1&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Senders Names Api */

public string GetSenderNames(string user_name, string pass)
{

string auth_url="https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*Get Balance Api */

public string GetBalance(string api_token)
{

string auth_url="https://www.marsooly.com/api/GetSMSCredit.aspx?api_token=api_token;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

/*send message Api */

public string sendmessage(string user_name, string pass, string mobile, string message, string sendername)
{

string _url="https://www.marsooly.com/api/httpSms.aspx?
string _param;
_param="username="+user_name+"&password="+pass+"&mobile="+mobile+"&message="+message+"&sender="+sendername;
string send_url;
send_url=_url + _param ;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( send_url ) ;
request.Method = "POST";
var data = Encoding.UTF8.GetBytes(send_url);
request.ContentLength = data.Length;
var streamwritter = request.GetRequestStream();
streamwritter.Write(data, 0, data.Length);
streamwritter.Close();

var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

'Authentication Api

Public Function Authentication ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=1&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Get Sender Names Api

Public Function getSenderNames ( ByVal user_name As String , ByVal user_name As String ) As String

Dim auth_url As String = "https://www.marsooly.com/api/users.aspx?code=8&username="+user_name+"&password="+pass
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Get Balance Api

Public Function GetBalance ( ByVal api_token As String) As String

Dim auth_url As String = "https://www.marsooly.com/api/GetSMSCredit.aspx?api_token="+api_token
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

'Send Message Api

Public Function SendMessage ( ByVal user_name As String , ByVal user_name As String , ByVal mobile As String , ByVal message As String , ByVal sendername As String ) As String

Dim postData As String = ""
postData=username="+user_name+"&password="+pass +"&mobile="+mobile+"&message="+message+"&sender="+sendername
Dim send_url As String = "https://www.marsooly.com/api/users.aspx
Dim result As String = ""
Try

Dim encoding As UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim request As HttpWebRequest = DirectCast(WebRequest.Create(send_url), HttpWebRequest )
request.Method = "POST"
request.KeepAlive = True
request.ContentLength = byteData.Length
request.ContentType = "application/x-www-form-urlencoded"
Dim postreqstream As Stream = request.GetRequestStream ()
postreqstream.Write(byteData , 0 , byteData.Length )
postreqstream.Close ()
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

Public Sub Authentication()
	Dim username As String
	Dim password As String
	Dim result As String
	Dim myURL As String
	Dim code As String =1
	Dim postData As String
	Dim winHttpReq As Object
	username = "your username"
	password = "your password"

 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/users.aspx?"
	postData = "username=" + username + "&password=" + password + "&code=" + code 
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	Authentication = winHttpReq.responseText
End Sub
Public Sub GetSenderNames()
	Dim username As String
	Dim password As String
	Dim result As String
	Dim myURL As String
	Dim code As String =8
	Dim postData As String
	Dim winHttpReq As Object
	username = "your username"
	password = "your password"

 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/users.aspx?"
	postData = "username=" + username + "&password=" + password + "&code=" + code 
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	GetSenderNames = winHttpReq.responseText
End Sub
Public Sub GetBalance()
	Dim api_token As String
	Dim result As String
	Dim myURL As String
	Dim postData As String
	Dim winHttpReq As Object
	api_token = "your api_token"
	
 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/GetSMSCredit.aspx?"
	postData = "api_token=" + api_token 
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	GetBalance = winHttpReq.responseText
End Sub
Public Sub SendMessage()
	Dim username As String
	Dim password As String
	Dim mobile As String
	Dim message As String
	Dim sender As String
	Dim result As String
	Dim myURL As String
	Dim postData As String
	Dim winHttpReq As Object
	username = "your username"
	password = "your password"
    mobile = "9665xxxxxxxx1,9665xxxxxxxx2"
    message = "your message"
    sender = "your sender name"

 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/httpSms.aspx?"
	postData = "username=" + username + "&password=" + password"&mobile=" + mobile"&message=" + message"&sender=" + sender
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	result = winHttpReq.responseText
End Sub
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String Authentication() {
		try {
			
            // Construct data
			String username = "username=" + "your username";
            String password = "&password=" + "your password";
			String code = "&code=1";
			

			// Authentication data
			HttpURLConnection conn =(HttpURLConnection)new URL("https://www.marsooly.com/api/users.aspx?").openConnection();
			String data = username + password + code ;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String GetSenderNames() {
		try {
			
            // Construct data
			String username = "username=" + "your username";
            String password = "&password=" + "your password";
			String code = "&code=8";
			

			// get senders names data
			HttpURLConnection conn = (HttpURLConnection) new URL("https://www.marsooly.com/api/users.aspx?").openConnection();
			String data = username + password + code ;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String GetBalance() {
		try {
			
            // Construct data
			String api_token = "api_token=" + "your api_token";
            

			// Get Balance data
			HttpURLConnection conn =(HttpURLConnection)new URL("https://www.marsooly.com/api/GetSMSCredit.aspx?").openConnection();
			String data = api_token ;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String SendMessage() {
		try {
			
            // Construct data
			String username = "username=" + "your username";
            String password = "&password=" + "your password";
			String message = "&message=" + "here is your message";
			String sender = "&sender=" + "sender name here";
			String mobile = "&mobile=" + "9665xxxxxxxx1,9665xxxxxxxx2";


			// Send data
			HttpURLConnection conn = (HttpURLConnection) new URL("https://www.marsooly.com/api/httpSms.aspx?").openConnection();
			String data = username + password + mobile + message + sender;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}

    
	Dim  username  As String = "your username"
    Dim  password  As String = "your password"
	Dim  code  As String = "1"
	Dim  link  As String = "http://www.marsooly.com/api/users.aspx?"
	Dim  url  As String =  link & "username=" & username & "&password=" & password & "&code=" & code 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    

    
	Dim  username  As String = "your username"
    Dim  password  As String = "your password"
	Dim  code  As String = "8"
	Dim  link  As String = "http://www.marsooly.com/api/users.aspx?"
	Dim  url  As String =  link & "username=" & username & "&password=" & password & "&code=" & code 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    

    
	Dim  api_token  As String = "your api_token"
   Dim  link  As String = "https://www.marsooly.com/api/GetSMSCredit.aspx?"
	Dim  url  As String =  link & "api_token=" & api_token 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    

    
	Dim  username  As String = "your username"
    Dim  password  As String = "your password"
	Dim  message  As String = "your message here"
	Dim  mobile  As String = "9665xxxxxxxx1,9665xxxxxxxx2"
	Dim  sender  As String = "your sender name here"
	Dim  link  As String = "http://www.marsooly.com/api/httpSms.aspx?"
	Dim  url  As String =  link & "username=" & username & "&password=" & password & "&message=" & message "&mobile=" & mobile "&sender=" & sender 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    
#!/usr/bin/env python

import urllib.request
import urllib.parse

def Authentication(username, password, code):
    data =  urllib.parse.urlencode({'username': username, 'password': password,'code' : code})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api.users.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  Authentication('username', '***********','1')
print (resp)
#!/usr/bin/env python

import urllib.request
import urllib.parse

def GetSenderNames(username, password, code):
    data =  urllib.parse.urlencode({'username': username, 'password': password,'code' : code})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api.users.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  GetSenderNames('username', '**********','8')
print (resp)
#!/usr/bin/env python

import urllib.request
import urllib.parse

def GetBalance(api_token):
    data =  urllib.parse.urlencode({'api_token': api_token})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api/GetSMSCredit.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  GetBalance('api_token')
print (resp)
#!/usr/bin/env python

import urllib.request
import urllib.parse

def SendMessage(username, password, message, mobile, sender):
    data =  urllib.parse.urlencode({'username': username, 'password': password,'message' : message, 'mobile': mobile, 'sender': sender})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api.httpSms.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  SendMessage('username', '**********','your message here', '9665xxxxxxx1,9665xxxxxxx2', 'yuor sender name here')
print (resp)
function Authentication(username, password, Sender, mobile,Message: String):string;
    const URL = 'https://www.marsooly.com/api/users.aspx?code=1&username=%s&password=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[username,password]); 
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
function GetSenderNames(username, password, Sender, mobile,Message: String):string;
    const URL = 'https://www.marsooly.com/api/users.aspx?code=8&username=%s&password=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[username,password]); 
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
function GetBalance(api_token):string;
    const URL = 'https://www.marsooly.com/api/GetSMSCredit.aspx?api_token=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[api_token]); 
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
function SendSMS(username, password, Sender, mobile,Message: String):string;
    const URL = 'https://www.marsooly.com/api/httpSms.aspx?username=%s&password=%s&sender=%s&mobile=%s&message=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[username,password,Sender,mobile,HttpEncode(Message)]);
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $code = "1";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/users.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'code'	=> $code
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $code = "8";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/users.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'code'	=> $code
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $api_token = 'your api_token'; 
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/GetSMSCredit.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'api_token'	=> $api_token]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $sender = "your sender name";
my $mobile = "9665xxxxxxxx,9665xxxxxxxx";
my $message = "here is your message";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/httpSms.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'mobile'	=> $mobile,
		'message'	=> $message,
		'sender'	=> $sender
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/users.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'code' => '1')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/users.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'code' => '8')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/GetSMSCredit.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'api_token' => 'your api_token')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/httpSms.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'message' => 'here is your message', 'sender' => 'your sender name', 'mobile' => '9665xxxxxxxx,9665xxxxxxxx')
response = JSON.parse(res.body)
puts (response)

Sample Response Example

3101 both user name and password are correct
Failure Codes
3102 either user name or password are incorrect or both of them
3103 user name don’t exist
3104 the account is not active
3105 parameter is missing
1015 No Response.

Get Senders ID

This funcion used to to get senders id which are acitve in Marsooly sms api.

URL https://www.marsooly.com/api/GetSenderNames.aspx
Parameters
api_token This filed for api token key registred in Marsooly sms api .

Sample Request Example

You can see all programming scripts for send message requests examples from here

<?php

function GetSenderNames($api_token)
{

$url = 'https://www.marsooly.com/api/GetSenderNames.aspx?api_token=$api_token;

$ch =curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$content = curl_exec($ch);
echo $content;

}
$api_token = "api_token here";
//Get SenderNames
GetSenderNames($api_token);
?>

/*GetSenderNames Api */

public string GetSenderNames(string api_token)
{

string auth_url="https://www.marsooly.com/api/GetSenderNames.aspx?api_token="+api_token;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

'GetSenderNames Api

Public Function GetSenderNames ( ByVal api_token As String) As String

Dim auth_url As String = "https://www.marsooly.com/api/GetSenderNames.aspx?api_token=api_token
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

<%
	api_token = "api_token"
   
    link = "https://www.marsooly.com/api/GetSenderNames.aspx?"
	url = link & "api_token=" & api_token 
     Dim xmlhttp
	set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "POST", url, false
	xmlhttp.send ""
	msg = xmlhttp.responseText
	response.write(msg)
	set xmlhttp = nothing
%>

/*GetSenderNames Api */

public string GetSenderNames(string api_token)
{

string auth_url="https://www.marsooly.com/api/GetSenderNames.aspx?api_token=api_token;
string return_value="";
try
{

var request = (HttpWebRequest ) WebRequest .Create ( auth_url ) ;
var response = ( HttpWebResponse ) request .GetResponse () ;
var streamReader = new StreamReader ( response .GetResponseStream ()) ;
return_value = streamReader .ReadToEnd () .ToString () ;
streamReader .Close () ;
return return_value ;
}
catch ( Exception exc )
{
return exc .Message ;
}
finally
{
}

}

'GetSenderNames Api

Public Function GetSenderNames ( ByVal api_token As String) As String

Dim auth_url As String = "https://www.marsooly.com/api/GetSenderNames.aspx?api_token="+api_token
Dim result As String = ""
Try

Dim request As HttpWebRequest = DirectCast ( WebRequest.Create ( auth_url ) , HttpWebRequest )
Dim httpwr As HttpWebResponse = DirectCast ( request.GetResponse () , HttpWebResponse )
Dim streamReader As New StreamReader ( httpwr.GetResponseStream () )
result = streamReader.ReadToEnd ()
streamReader.Close ()
Return result

Catch ex As Exception
Return ex.Message
End Try

End Function

Public Sub GetSenderNames()
	Dim api_token As String
	Dim result As String
	Dim myURL As String
	Dim postData As String
	Dim winHttpReq As Object
	api_token = "your api_token"
	
 
	Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
	myURL = "https://www.marsooly.com/api/GetSenderNames.aspx?"
	postData = "api_token=" + api_token 
 
	winHttpReq.Open "POST", myURL, False
	winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	winHttpReq.Send (postData)
 
	GetSenderNames = winHttpReq.responseText
End Sub
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

public class Api {
	public String GetSenderNames() {
		try {
			
            // Construct data
			String api_token = "api_token=" + "your api_token";
            

			// GetSenderNames data
			HttpURLConnection conn =(HttpURLConnection)new URL("https://www.marsooly.com/api/GetSenderNames.aspx?").openConnection();
			String data = api_token ;
			conn.setDoOutput(true);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
			conn.getOutputStream().write(data.getBytes("UTF-8"));
			final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
			final StringBuffer stringBuffer = new StringBuffer();
			String line;
			while ((line = rd.readLine()) != null) {
				stringBuffer.append(line);
			}
			rd.close();

			return stringBuffer.toString();
		} catch (Exception e) {
			System.out.println("Error SMS "+e);
			return "Error "+e;
		}
	}
}

    
	Dim  api_token  As String = "your api_token"
   Dim  link  As String = "https://www.marsooly.com/api/GetSenderNames.aspx?"
	Dim  url  As String =  link & "api_token=" & api_token 
    
    Dim  result  As String = Inet1.OpenURL(url ,  icString) 

    
#!/usr/bin/env python

import urllib.request
import urllib.parse

def GetSenderNames(api_token):
    data =  urllib.parse.urlencode({'api_token': api_token})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://www.marsooly.com/api/GetSenderNames.aspx?")
    f = urllib.request.urlopen(request, data)
    fr = f.read()
    return(fr)

resp =  GetSenderNames('api_token')
print (resp)
function GetSenderNames(api_token):string;
    const URL = 'https://www.marsooly.com/api/GetSenderNames.aspx?api_token=%s';
      ResponseSize = 1024;
    var
      hSession, hURL: HInternet;
      Request: String;

      ResponseLength: Cardinal;
    begin
      hSession := InternetOpen('DrBob42', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
      try
        Request := Format(URL,[api_token]); 
        hURL := InternetOpenURL(hSession, PChar(Request), nil, 0,0,0);
        try
          SetLength(Result, ResponseSize);
          InternetReadFile(hURL, PChar(Result), ResponseSize,
            ResponseLength);
          SetLength(Result, ResponseLength)
        finally
          InternetCloseHandle(hURL)
        end
      finally
        InternetCloseHandle(hSession)
      end
    end;
<
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $code = "1";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/users.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'code'	=> $code
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $code = "8";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/users.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'code'	=> $code
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $code = "7";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/users.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'code'	=> $code
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $username = 'your username'; 
my $password = 'your password'; 
my $sender = "your sender name";
my $mobile = "9665xxxxxxxx,9665xxxxxxxx";
my $message = "here is your message";
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/httpSms.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'username'	=> $username,
		'password'	=> $password,
		'mobile'	=> $mobile,
		'message'	=> $message,
		'sender'	=> $sender
		]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/users.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'code' => '1')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/users.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'code' => '8')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/users.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'code' => '7')
response = JSON.parse(res.body)
puts (response)
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/httpSms.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'username' => 'your username', 'password' => 'your password', 'message' => 'here is your message', 'sender' => 'your sender name', 'mobile' => '9665xxxxxxxx,9665xxxxxxxx')
response = JSON.parse(res.body)
puts (response)
#!/usr/bin/perl

use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $api_token = 'your api_token'; 
my $ua = LWP::UserAgent->new();

my $res = $ua->request
(
 POST 'https://www.marsooly.com/api/GetSenderNames.aspx?',
 Content_Type  => 'application/x-www-form-urlencoded',
 Content       => [
		'api_token'	=> $api_token]
);

if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";
require "rubygems"
require "net/https"
require "uri"
require "json"

requested_url = 'https://www.marsooly.com/api/GetSenderNames.aspx?'

uri = URI.parse(requested_url)
http = Net::HTTP.start(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

res = Net::HTTP.post_form(uri, 'api_token' => 'your api_token')
response = JSON.parse(res.body)
puts (response)

Sample Response Example

3101 both user name and password are correct
Failure Codes
3102 either user name or password are incorrect or both of them
3103 user name don’t exist
3104 the account is not active
3105 parameter is missing
1015 No Response.

Get Main Groups

This funcion used to to get all main groups of user in Marsooly in Json fomrat .

URL https://www.marsooly.com/api/groups.aspx
Parameters
username This filed for username registred in Marsooly sms api .
password This filed for password registred in Marsooly sms api .
code value of this code is 1

Sample Request Example

You can see all programming scripts for send message requests examples from here

Sample Response Json Format Example

{ "MainGroups": [ { "Group_Name": "First Group", "Group_ID": "8867867" }, { "Group_Name": "Second Group", "Group_ID": "464567" }, { "Group_Name": "1", "Group_ID": "434235" }, { "Group_Name": "2", "Group_ID": "56456456" }, { "Group_Name": "3", "Group_ID": "980887" }, { "Group_Name": "5", "Group_ID": "78678678" }, { "Group_Name": "6", "Group_ID": "43345" }, { "Group_Name": "7", "Group_ID": "655466" }, { "Group_Name": "10", "Group_ID": "6577457" }, { "Group_Name": "13", "Group_ID": "689869" }, { "Group_Name": "4", "Group_ID": "8767867" }, { "Group_Name": "New test", "Group_ID": "88677665" } ] }

Get Sub Groups

This funcion used to to get all Sub groups of specific main group user in Marsooly in Json fomrat .

URL https://www.marsooly.com/api/groups.aspx
Parameters
username This filed for username registred in Marsooly sms api .
password This filed for password registred in Marsooly sms api .
code value of this code is 2
Group_id the id of main group

Sample Request Example

You can see all programming scripts for send message requests examples from here

Sample Response Json Format Example

{ "SubGroups": [ { "SubGroup_Name": "1-2", "SubGroup_ID": "43242" }, { "SubGroup_Name": "New sun group", "SubGroup_ID": "76576" }, { "SubGroup_Name": "1-3", "SubGroup_ID": "123123" }, { "SubGroup_Name": "1-4", "SubGroup_ID": "98909" } ] }

Get Contacts of Groups

This funcion used to to get all contacts of sub group user in Marsooly in Json fomrat .

URL https://www.marsooly.com/api/groups.aspx
Parameters
username This filed for username registred in Marsooly sms api .
password This filed for password registred in Marsooly sms api .
code value of this code is 3
subGroup_id the id of sub group

Sample Request Example

You can see all programming scripts for send message requests examples from here

Sample Response Json Format Example

"Contacts": [ { "Contacts_Name": "Name-1", "Contacts_Mobile": "9665xxxxxxx1" }, { "Contacts_Name": "Name-2", "Contacts_Mobile": "9665xxxxxxx2" }, { "Contacts_Name": "Name-3", "Contacts_Mobile": "9665xxxxxxx3" }, { "Contacts_Name": "Name-4", "Contacts_Mobile": "9665xxxxxxx4" }, { "Contacts_Name": "Name-n", "Contacts_Mobile": "9665xxxxxxxn" } ] }