This describes the all Services that allow you deal with our API .
use this
http://api.smsgw.net/
OR http://api2.smsgw.net/
Parameter | Definition | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
strUserName | The username or Mobile number (format: 9665xxxxxxx). | ||||||||||||||||||||||||
strPassword | The account password. | ||||||||||||||||||||||||
strTagName | The sender name in alphanumeric format. | ||||||||||||||||||||||||
strRecepientNumbers | One or more mobile number separated by a semicolon(;)[used in SendBulkSMS service (format: Use 05xxxxxxxx, 5xxxxxxxx, 9665xxxxxxxx, 009665xxxxxxxx for any national mobile number and use the format 00 then country code or + then country code for any international mobile number). | ||||||||||||||||||||||||
strMessage | Message content (70 Character for the 1 st single message and 67 for more than single message for ARABIC Message, and 160 Character for the 1 st single message and 158 for more than single message for ENGLISH Message.). | ||||||||||||||||||||||||
sendDateTime | Server Date time of sending the message, used for scheduled messages (which must be at least 5 minutes a head), to send directly provide without schedule (0) zero value. To send on scheduled date use format (yyyyMMddHHmm) (ex: 201412081638) as long value | ||||||||||||||||||||||||
VarsList | List of variables to be replaced in custom message service, which separated by semicolon (;) e.g.: [Name];[Salary]. The variables list could be anything except the semicolon itself. | ||||||||||||||||||||||||
ReplacementList | List of replacements, which separated by semicolon (;) e.g.: Name1,5000;Name2,4000. | ||||||||||||||||||||||||
strCode | The number you will get after calling as Service
|
||||||||||||||||||||||||
strSubUserName | The username or Mobile number for sub account. | ||||||||||||||||||||||||
strSubPassword | The password for sub account. | ||||||||||||||||||||||||
strPoints | The sub account messages count. |
Service allows you to know error code values that are produced by our system.
POST http://api.smsgw.net/GetstrCodeDescription
Parameter | Type | Required | Example |
---|---|---|---|
strCode | Integer | Yes | 0 |
Request:
curl "http://api.smsgw.net/GetstrCodeDescription" \
-X POST \
-d strCode=0 \
<?php
$curl = curl_init();
$post = [
'strCode' => '0',
];
curl_setopt_array($curl, [
CURLOPT_URL => 'http://api.smsgw.net/GetstrCodeDescription',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
]);
$output = curl_exec($curl);
curl_close($curl);
echo $output;
?>
require 'net/http'
uri = URI('http://api.smsgw.net/GetstrCodeDescription')
res = Net::HTTP.post_form(uri, "strCode" => "0",)
puts res.body
import requests
post_data = {'strCode':'0',}
response = requests.post('http://api.smsgw.net/GetstrCodeDescription',post_data)
print(response.text)
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class smsapi {
private final String USER_AGENT = "API Client/0.0.1";
public static void main(String[] args) throws Exception {
smsapi http = new smsapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://api.smsgw.net/GetstrCodeDescription";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "strCode=0&";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("http://api.smsgw.net/GetstrCodeDescription");
var postData = "strCode=0&";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'http://api.smsgw.net/GetstrCodeDescription',
method: 'POST',
headers: headers,
form: {'strCode':'0',}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})
Service allows you to inquire about available messages balance remaining in your account.
POST http://api.smsgw.net/GetCredit
Parameter | Type | Required | Example |
---|---|---|---|
strUserName | String | Yes | 9665xxxxxxx |
strPassword | String | Yes |
Request:
curl "http://api.smsgw.net/GetCredit" \
-X POST \
-d strUserName=9665xxxxxxx \
-d strPassword= \
<?php
$curl = curl_init();
$post = [
'strUserName' => '9665xxxxxxx',
'strPassword' => '',
];
curl_setopt_array($curl, [
CURLOPT_URL => 'http://api.smsgw.net/GetCredit',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
]);
$output = curl_exec($curl);
curl_close($curl);
echo $output;
?>
require 'net/http'
uri = URI('http://api.smsgw.net/GetCredit')
res = Net::HTTP.post_form(uri, "strUserName" => "9665xxxxxxx","strPassword" => "",)
puts res.body
import requests
post_data = {'strUserName':'9665xxxxxxx','strPassword':'',}
response = requests.post('http://api.smsgw.net/GetCredit',post_data)
print(response.text)
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class smsapi {
private final String USER_AGENT = "API Client/0.0.1";
public static void main(String[] args) throws Exception {
smsapi http = new smsapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://api.smsgw.net/GetCredit";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "strUserName=9665xxxxxxx&strPassword=&";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("http://api.smsgw.net/GetCredit");
var postData = "strUserName=9665xxxxxxx&strPassword=&";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'http://api.smsgw.net/GetCredit',
method: 'POST',
headers: headers,
form: {'strUserName':'9665xxxxxxx','strPassword':'',}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})
Service allows you to check if the service is working or not. [You may use this before sending messages to check the service status].
GET http://api.smsgw.net/IsServiceAlive
Parameter | Type | Required | Example |
---|
Request:
curl "http://api.smsgw.net/IsServiceAlive" \
-X GET \
<?php
$curl = curl_init();
$post = [
];
curl_setopt_array($curl, [
CURLOPT_URL => 'http://api.smsgw.net/IsServiceAlive',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
]);
$output = curl_exec($curl);
curl_close($curl);
echo $output;
?>
require 'net/http'
uri = URI('http://api.smsgw.net/IsServiceAlive')
res = Net::HTTP.post_form(uri, )
puts res.body
import requests
post_data = {}
response = requests.post('http://api.smsgw.net/IsServiceAlive',post_data)
print(response.text)
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class smsapi {
private final String USER_AGENT = "API Client/0.0.1";
public static void main(String[] args) throws Exception {
smsapi http = new smsapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://api.smsgw.net/IsServiceAlive";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("http://api.smsgw.net/IsServiceAlive");
var postData = "";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'http://api.smsgw.net/IsServiceAlive',
method: 'POST',
headers: headers,
form: {}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})
Service allows you to send message to multiple mobile numbers in one call.
POST http://api.smsgw.net/SendBulkSMS
Parameter | Type | Required | Example |
---|---|---|---|
strUserName | String | Yes | 9665xxxxxxx |
strPassword | String | Yes | |
strTagName | String | Yes | SMSgw.net |
strRecepientNumbers | String | Yes | 05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx |
strMessage | String | Yes | Test Message |
sendDateTime | Date | No | yyyyMMddHHmm (201412081638) |
Request:
curl "http://api.smsgw.net/SendBulkSMS" \
-X POST \
-d strUserName=9665xxxxxxx \
-d strPassword= \
-d strTagName=SMSgw.net \
-d strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx \
-d strMessage=Test Message \
-d sendDateTime=yyyyMMddHHmm (201412081638) \
<?php
$curl = curl_init();
$post = [
'strUserName' => '9665xxxxxxx',
'strPassword' => '',
'strTagName' => 'SMSgw.net',
'strRecepientNumbers' => '05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx',
'strMessage' => 'Test Message',
'sendDateTime' => 'yyyyMMddHHmm (201412081638)',
];
curl_setopt_array($curl, [
CURLOPT_URL => 'http://api.smsgw.net/SendBulkSMS',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
]);
$output = curl_exec($curl);
curl_close($curl);
echo $output;
?>
require 'net/http'
uri = URI('http://api.smsgw.net/SendBulkSMS')
res = Net::HTTP.post_form(uri, "strUserName" => "9665xxxxxxx","strPassword" => "","strTagName" => "SMSgw.net","strRecepientNumbers" => "05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx","strMessage" => "Test Message","sendDateTime" => "yyyyMMddHHmm (201412081638)",)
puts res.body
import requests
post_data = {'strUserName':'9665xxxxxxx','strPassword':'','strTagName':'SMSgw.net','strRecepientNumbers':'05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx','strMessage':'Test Message','sendDateTime':'yyyyMMddHHmm (201412081638)',}
response = requests.post('http://api.smsgw.net/SendBulkSMS',post_data)
print(response.text)
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class smsapi {
private final String USER_AGENT = "API Client/0.0.1";
public static void main(String[] args) throws Exception {
smsapi http = new smsapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://api.smsgw.net/SendBulkSMS";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "strUserName=9665xxxxxxx&strPassword=&strTagName=SMSgw.net&strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx&strMessage=Test Message&sendDateTime=yyyyMMddHHmm (201412081638)&";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("http://api.smsgw.net/SendBulkSMS");
var postData = "strUserName=9665xxxxxxx&strPassword=&strTagName=SMSgw.net&strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx&strMessage=Test Message&sendDateTime=yyyyMMddHHmm (201412081638)&";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'http://api.smsgw.net/SendBulkSMS',
method: 'POST',
headers: headers,
form: {'strUserName':'9665xxxxxxx','strPassword':'','strTagName':'SMSgw.net','strRecepientNumbers':'05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx','strMessage':'Test Message','sendDateTime':'yyyyMMddHHmm (201412081638)',}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})
Service allows you to send message to multiple mobile numbers in one call and replace VarsList with ReplacementList in each SMS.
POST http://api.smsgw.net/SendCustomBulkSMS
Parameter | Type | Required | Example |
---|---|---|---|
strUserName | String | Yes | 9665xxxxxxx |
strPassword | String | Yes | |
strTagName | String | Yes | SMSgw.net |
strRecepientNumbers | String | Yes | 05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx |
strMessage | String | Yes | Mr [Name] your salary is [Salary] |
VarsList | String | Yes | [Name];[Salary] |
ReplacementList | String | Yes | Name1,5000;Name2,4000;Name3,3000;Name4,2000 |
Request:
curl "http://api.smsgw.net/SendCustomBulkSMS" \
-X POST \
-d strUserName=9665xxxxxxx \
-d strPassword= \
-d strTagName=SMSgw.net \
-d strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx \
-d strMessage=Mr [Name] your salary is [Salary] \
-d VarsList=[Name];[Salary] \
-d ReplacementList=Name1,5000;Name2,4000;Name3,3000;Name4,2000 \
<?php
$curl = curl_init();
$post = [
'strUserName' => '9665xxxxxxx',
'strPassword' => '',
'strTagName' => 'SMSgw.net',
'strRecepientNumbers' => '05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx',
'strMessage' => 'Mr [Name] your salary is [Salary]',
'VarsList' => '[Name];[Salary]',
'ReplacementList' => 'Name1,5000;Name2,4000;Name3,3000;Name4,2000',
];
curl_setopt_array($curl, [
CURLOPT_URL => 'http://api.smsgw.net/SendCustomBulkSMS',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
]);
$output = curl_exec($curl);
curl_close($curl);
echo $output;
?>
require 'net/http'
uri = URI('http://api.smsgw.net/SendCustomBulkSMS')
res = Net::HTTP.post_form(uri, "strUserName" => "9665xxxxxxx","strPassword" => "","strTagName" => "SMSgw.net","strRecepientNumbers" => "05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx","strMessage" => "Mr [Name] your salary is [Salary]","VarsList" => "[Name];[Salary]","ReplacementList" => "Name1,5000;Name2,4000;Name3,3000;Name4,2000",)
puts res.body
import requests
post_data = {'strUserName':'9665xxxxxxx','strPassword':'','strTagName':'SMSgw.net','strRecepientNumbers':'05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx','strMessage':'Mr [Name] your salary is [Salary]','VarsList':'[Name];[Salary]','ReplacementList':'Name1,5000;Name2,4000;Name3,3000;Name4,2000',}
response = requests.post('http://api.smsgw.net/SendCustomBulkSMS',post_data)
print(response.text)
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class smsapi {
private final String USER_AGENT = "API Client/0.0.1";
public static void main(String[] args) throws Exception {
smsapi http = new smsapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://api.smsgw.net/SendCustomBulkSMS";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "strUserName=9665xxxxxxx&strPassword=&strTagName=SMSgw.net&strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx&strMessage=Mr [Name] your salary is [Salary]&VarsList=[Name];[Salary]&ReplacementList=Name1,5000;Name2,4000;Name3,3000;Name4,2000&";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("http://api.smsgw.net/SendCustomBulkSMS");
var postData = "strUserName=9665xxxxxxx&strPassword=&strTagName=SMSgw.net&strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx&strMessage=Mr [Name] your salary is [Salary]&VarsList=[Name];[Salary]&ReplacementList=Name1,5000;Name2,4000;Name3,3000;Name4,2000&";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'http://api.smsgw.net/SendCustomBulkSMS',
method: 'POST',
headers: headers,
form: {'strUserName':'9665xxxxxxx','strPassword':'','strTagName':'SMSgw.net','strRecepientNumbers':'05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx','strMessage':'Mr [Name] your salary is [Salary]','VarsList':'[Name];[Salary]','ReplacementList':'Name1,5000;Name2,4000;Name3,3000;Name4,2000',}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})
Service allows you to send single message to one international mobile number.
POST http://api.smsgw.net/SendInternationalSMS
Parameter | Type | Required | Example |
---|---|---|---|
strUserName | String | Yes | 9665xxxxxxx |
strPassword | String | Yes | |
strTagName | String | Yes | SMSgw.net |
strRecepientNumbers | String | Yes | 05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx |
strMessage | String | Yes | Test Message |
sendDateTime | Date | No | yyyyMMddHHmm (201412081638) |
Request:
curl "http://api.smsgw.net/SendInternationalSMS" \
-X POST \
-d strUserName=9665xxxxxxx \
-d strPassword= \
-d strTagName=SMSgw.net \
-d strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx \
-d strMessage=Test Message \
-d sendDateTime=yyyyMMddHHmm (201412081638) \
<?php
$curl = curl_init();
$post = [
'strUserName' => '9665xxxxxxx',
'strPassword' => '',
'strTagName' => 'SMSgw.net',
'strRecepientNumbers' => '05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx',
'strMessage' => 'Test Message',
'sendDateTime' => 'yyyyMMddHHmm (201412081638)',
];
curl_setopt_array($curl, [
CURLOPT_URL => 'http://api.smsgw.net/SendInternationalSMS',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
]);
$output = curl_exec($curl);
curl_close($curl);
echo $output;
?>
require 'net/http'
uri = URI('http://api.smsgw.net/SendInternationalSMS')
res = Net::HTTP.post_form(uri, "strUserName" => "9665xxxxxxx","strPassword" => "","strTagName" => "SMSgw.net","strRecepientNumbers" => "05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx","strMessage" => "Test Message","sendDateTime" => "yyyyMMddHHmm (201412081638)",)
puts res.body
import requests
post_data = {'strUserName':'9665xxxxxxx','strPassword':'','strTagName':'SMSgw.net','strRecepientNumbers':'05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx','strMessage':'Test Message','sendDateTime':'yyyyMMddHHmm (201412081638)',}
response = requests.post('http://api.smsgw.net/SendInternationalSMS',post_data)
print(response.text)
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class smsapi {
private final String USER_AGENT = "API Client/0.0.1";
public static void main(String[] args) throws Exception {
smsapi http = new smsapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://api.smsgw.net/SendInternationalSMS";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "strUserName=9665xxxxxxx&strPassword=&strTagName=SMSgw.net&strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx&strMessage=Test Message&sendDateTime=yyyyMMddHHmm (201412081638)&";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("http://api.smsgw.net/SendInternationalSMS");
var postData = "strUserName=9665xxxxxxx&strPassword=&strTagName=SMSgw.net&strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx&strMessage=Test Message&sendDateTime=yyyyMMddHHmm (201412081638)&";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'http://api.smsgw.net/SendInternationalSMS',
method: 'POST',
headers: headers,
form: {'strUserName':'9665xxxxxxx','strPassword':'','strTagName':'SMSgw.net','strRecepientNumbers':'05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx','strMessage':'Test Message','sendDateTime':'yyyyMMddHHmm (201412081638)',}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})
Service allows you to send single message to one mobile number in one call.
POST http://api.smsgw.net/SendSingleSMS
Parameter | Type | Required | Example |
---|---|---|---|
strUserName | String | Yes | 9665xxxxxxx |
strPassword | String | Yes | |
strTagName | String | Yes | SMSgw.net |
strRecepientNumbers | String | Yes | 05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx |
strMessage | String | Yes | Test Message |
sendDateTime | Date | No | yyyyMMddHHmm (201412081638) |
Request:
curl "http://api.smsgw.net/SendSingleSMS" \
-X POST \
-d strUserName=9665xxxxxxx \
-d strPassword= \
-d strTagName=SMSgw.net \
-d strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx \
-d strMessage=Test Message \
-d sendDateTime=yyyyMMddHHmm (201412081638) \
<?php
$curl = curl_init();
$post = [
'strUserName' => '9665xxxxxxx',
'strPassword' => '',
'strTagName' => 'SMSgw.net',
'strRecepientNumbers' => '05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx',
'strMessage' => 'Test Message',
'sendDateTime' => 'yyyyMMddHHmm (201412081638)',
];
curl_setopt_array($curl, [
CURLOPT_URL => 'http://api.smsgw.net/SendSingleSMS',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
]);
$output = curl_exec($curl);
curl_close($curl);
echo $output;
?>
require 'net/http'
uri = URI('http://api.smsgw.net/SendSingleSMS')
res = Net::HTTP.post_form(uri, "strUserName" => "9665xxxxxxx","strPassword" => "","strTagName" => "SMSgw.net","strRecepientNumbers" => "05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx","strMessage" => "Test Message","sendDateTime" => "yyyyMMddHHmm (201412081638)",)
puts res.body
import requests
post_data = {'strUserName':'9665xxxxxxx','strPassword':'','strTagName':'SMSgw.net','strRecepientNumbers':'05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx','strMessage':'Test Message','sendDateTime':'yyyyMMddHHmm (201412081638)',}
response = requests.post('http://api.smsgw.net/SendSingleSMS',post_data)
print(response.text)
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class smsapi {
private final String USER_AGENT = "API Client/0.0.1";
public static void main(String[] args) throws Exception {
smsapi http = new smsapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://api.smsgw.net/SendSingleSMS";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "strUserName=9665xxxxxxx&strPassword=&strTagName=SMSgw.net&strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx&strMessage=Test Message&sendDateTime=yyyyMMddHHmm (201412081638)&";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("http://api.smsgw.net/SendSingleSMS");
var postData = "strUserName=9665xxxxxxx&strPassword=&strTagName=SMSgw.net&strRecepientNumbers=05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx&strMessage=Test Message&sendDateTime=yyyyMMddHHmm (201412081638)&";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'http://api.smsgw.net/SendSingleSMS',
method: 'POST',
headers: headers,
form: {'strUserName':'9665xxxxxxx','strPassword':'','strTagName':'SMSgw.net','strRecepientNumbers':'05xxxxxxxx,5xxxxxxxx,9665xxxxxxxx,009665xxxxxxxx','strMessage':'Test Message','sendDateTime':'yyyyMMddHHmm (201412081638)',}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})
Service allows you to create new sub account with initial balance.
POST http://api.smsgw.net/AddSubAccount
Parameter | Type | Required | Example |
---|---|---|---|
strUserName | String | Yes | 9665xxxxxxx |
strPassword | String | Yes | |
strSubUserName | String | Yes | 05xxxxxxxx |
strSubPassword | String | Yes | |
strPoints | Integer | Yes | 100 |
Request:
curl "http://api.smsgw.net/AddSubAccount" \
-X POST \
-d strUserName=9665xxxxxxx \
-d strPassword= \
-d strSubUserName=05xxxxxxxx \
-d strSubPassword= \
-d strPoints=100 \
<?php
$curl = curl_init();
$post = [
'strUserName' => '9665xxxxxxx',
'strPassword' => '',
'strSubUserName' => '05xxxxxxxx',
'strSubPassword' => '',
'strPoints' => '100',
];
curl_setopt_array($curl, [
CURLOPT_URL => 'http://api.smsgw.net/AddSubAccount',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
]);
$output = curl_exec($curl);
curl_close($curl);
echo $output;
?>
require 'net/http'
uri = URI('http://api.smsgw.net/AddSubAccount')
res = Net::HTTP.post_form(uri, "strUserName" => "9665xxxxxxx","strPassword" => "","strSubUserName" => "05xxxxxxxx","strSubPassword" => "","strPoints" => "100",)
puts res.body
import requests
post_data = {'strUserName':'9665xxxxxxx','strPassword':'','strSubUserName':'05xxxxxxxx','strSubPassword':'','strPoints':'100',}
response = requests.post('http://api.smsgw.net/AddSubAccount',post_data)
print(response.text)
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class smsapi {
private final String USER_AGENT = "API Client/0.0.1";
public static void main(String[] args) throws Exception {
smsapi http = new smsapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://api.smsgw.net/AddSubAccount";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "strUserName=9665xxxxxxx&strPassword=&strSubUserName=05xxxxxxxx&strSubPassword=&strPoints=100&";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("http://api.smsgw.net/AddSubAccount");
var postData = "strUserName=9665xxxxxxx&strPassword=&strSubUserName=05xxxxxxxx&strSubPassword=&strPoints=100&";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'http://api.smsgw.net/AddSubAccount',
method: 'POST',
headers: headers,
form: {'strUserName':'9665xxxxxxx','strPassword':'','strSubUserName':'05xxxxxxxx','strSubPassword':'','strPoints':'100',}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})
Service allows you to display sub account information.
POST http://api.smsgw.net/ListSubAccount
Parameter | Type | Required | Example |
---|---|---|---|
strUserName | String | Yes | 9665xxxxxxx |
strPassword | String | Yes | |
strSubUserName | String | Yes | 05xxxxxxxx |
Request:
curl "http://api.smsgw.net/ListSubAccount" \
-X POST \
-d strUserName=9665xxxxxxx \
-d strPassword= \
-d strSubUserName=05xxxxxxxx \
<?php
$curl = curl_init();
$post = [
'strUserName' => '9665xxxxxxx',
'strPassword' => '',
'strSubUserName' => '05xxxxxxxx',
];
curl_setopt_array($curl, [
CURLOPT_URL => 'http://api.smsgw.net/ListSubAccount',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
]);
$output = curl_exec($curl);
curl_close($curl);
echo $output;
?>
require 'net/http'
uri = URI('http://api.smsgw.net/ListSubAccount')
res = Net::HTTP.post_form(uri, "strUserName" => "9665xxxxxxx","strPassword" => "","strSubUserName" => "05xxxxxxxx",)
puts res.body
import requests
post_data = {'strUserName':'9665xxxxxxx','strPassword':'','strSubUserName':'05xxxxxxxx',}
response = requests.post('http://api.smsgw.net/ListSubAccount',post_data)
print(response.text)
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class smsapi {
private final String USER_AGENT = "API Client/0.0.1";
public static void main(String[] args) throws Exception {
smsapi http = new smsapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://api.smsgw.net/ListSubAccount";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "strUserName=9665xxxxxxx&strPassword=&strSubUserName=05xxxxxxxx&";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("http://api.smsgw.net/ListSubAccount");
var postData = "strUserName=9665xxxxxxx&strPassword=&strSubUserName=05xxxxxxxx&";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'http://api.smsgw.net/ListSubAccount',
method: 'POST',
headers: headers,
form: {'strUserName':'9665xxxxxxx','strPassword':'','strSubUserName':'05xxxxxxxx',}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})
Service allows you to delete sub account.
POST http://api.smsgw.net/DelSubAccount
Parameter | Type | Required | Example |
---|---|---|---|
strUserName | String | Yes | 9665xxxxxxx |
strPassword | String | Yes | |
strSubUserName | String | Yes | 05xxxxxxxx |
Request:
curl "http://api.smsgw.net/DelSubAccount" \
-X POST \
-d strUserName=9665xxxxxxx \
-d strPassword= \
-d strSubUserName=05xxxxxxxx \
<?php
$curl = curl_init();
$post = [
'strUserName' => '9665xxxxxxx',
'strPassword' => '',
'strSubUserName' => '05xxxxxxxx',
];
curl_setopt_array($curl, [
CURLOPT_URL => 'http://api.smsgw.net/DelSubAccount',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $post
]);
$output = curl_exec($curl);
curl_close($curl);
echo $output;
?>
require 'net/http'
uri = URI('http://api.smsgw.net/DelSubAccount')
res = Net::HTTP.post_form(uri, "strUserName" => "9665xxxxxxx","strPassword" => "","strSubUserName" => "05xxxxxxxx",)
puts res.body
import requests
post_data = {'strUserName':'9665xxxxxxx','strPassword':'','strSubUserName':'05xxxxxxxx',}
response = requests.post('http://api.smsgw.net/DelSubAccount',post_data)
print(response.text)
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
public class smsapi {
private final String USER_AGENT = "API Client/0.0.1";
public static void main(String[] args) throws Exception {
smsapi http = new smsapi();
System.out.println("\nTesting API - Send API POST request");
http.sendPost();
}
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://api.smsgw.net/DelSubAccount";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
//add reuqest header
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String urlParameters = "strUserName=9665xxxxxxx&strPassword=&strSubUserName=05xxxxxxxx&";
// Send post request
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
//print result
System.out.println(response.toString());
}
}
public static void Main(string[] args)
{
var request = (HttpWebRequest)WebRequest.Create("http://api.smsgw.net/DelSubAccount");
var postData = "strUserName=9665xxxxxxx&strPassword=&strSubUserName=05xxxxxxxx&";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Console.WriteLine(responseString);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
var request = require('request');
var headers = {
'User-Agent': 'API Client/0.0.1',
'Content-Type': 'application/x-www-form-urlencoded'
}
var options = {
url: 'http://api.smsgw.net/DelSubAccount',
method: 'POST',
headers: headers,
form: {'strUserName':'9665xxxxxxx','strPassword':'','strSubUserName':'05xxxxxxxx',}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})