You may use the link below and direct go to the topic:
Bulk SMS API Integration
Methods of sending SMS
- Send SMS with ASP
- Send SMS with Java
- Send SMS with C++
- Send SMS with C#
- Send SMS with PHP
- Send SMS with VB.net
Function of Bulk SMS Task Schedule
- How to Create Bulk SMS Task Scheduler with PHP code
- How to Update Bulk SMS Task Scheduler with PHP code
- How to Delete Bulk SMS Task Scheduler with PHP code
===================================================================================
Bulk SMS API Integration
Exabytes Malaysia now offers you to connect to our SMS gateway without any setup fees. By, using our SMS gateway you can automate your bulk text messaging and integrate Exabytes SMS service into any website or application using our Exabytes API.
In order to use Exabytes API to send mass SMS, you have to initiate a HTTPS request (POST/GET method).
Exabytes API - Send SMS
Parameter | Details | Example |
*un | Username of Exabytes account | exabytes |
*pwd | Password of Exabytes account | exabytes123 |
dstno | Mobile number that you wish to send a message (Append 00 for international numbers). | 6012xxxxxxxx |
*msg | The message body (MAX limit : 700 char) | Hi, John. How r u? |
type | Type of SMS
| 1 |
*agreedterm | Agreed Exabytes Term and Condition ,API will filter your sms if you do not agreed with the agreement. | YES |
*sendid (Optional) | Sender ID to be displayed on recipient's mobile phone. (Please notice that Malaysia Prefix does not support Sender ID) | 61000 |
* MUST URL Encoded HTTP Response Result
Single Recipient | |
Send SMS API via HTTPS: | |
Send SMS by Phone Number to Single Recipient via HTTPS: | https://smsportal.exabytes.my/isms_send.php? un=exabytes&pwd=exabytes123&dstno=60123456789 &msg=Hello%20World&type=1&sendid=12345 |
Send SMS by Group ID via HTTPS: | https://smsportal.exabytes.my/api_send_sms_by_group.php? un=exabytes&pwd=exabytes123&groupid=12345 &msg=Hello%20World&type=1&sendid=12345 |
Send SMS by Recipient Name via HTTPS: | https://smsportal.exabytes.my/api_send_sms_by_name.php? un=exabytes&pwd=exabytes123&name=contact1 &msg=Hello%20World&type=1 |
Multiple Recipient Separate each recipient with semi-colon(;) maximum 300 number per push | |
Send SMS by Phone Number to Multiple Recipient via HTTPS: | https://smsportal.exabytes.my/isms_send.php? un=exabytes&pwd=exabytes123&dstno=60123456789; 601254888999;6044478955 &msg=Hello%20World&type=1&sendid=12345 |
Contact List |
|
Get Contact List Group via HTTPS: | https://smsportal.exabytes.my/api_list_of_contact_group.php? un=exabytes&pwd=exabytes123 |
Get Contact List Based on the Group ID via HTTPS: | https://smsportal.exabytes.my/api_list_of_contact.php? un=exabytes&pwd=exabytes123& groupid=12345 |
Get All Contact List from Phone Book via HTTPS: | https://smsportal.exabytes.my/api_list_of_contact.php? un=exabytes&pwd=exabytes123 |
Contact Group |
|
Create New Group via HTTPS: | https://smsportal.exabytes.my/api_add_contact_group.php? un=exabytes&pwd=exabytes123&name=group1 |
Update Group Name via HTTPS: | https://smsportal.exabytes.my/api_edit_contact_group.php? un=exabytes&pwd=exabytes123&name=groupid=98765 |
Delete Group via HTTPS: | https://smsportal.exabytes.my/api_delete_contact_group.php? un=exabytes&pwd=exabytes123&name=groupid=98765 |
Server Response
API for SMS Task Scheduler
List All Task Schedule via HTTPS: | https://smsportal.exabytes.my/api_list_of_schedule.php? un=exabytes&pwd=exabytes123
|
Create New Task Schedule via HTTPS: | https://smsportal.exabytes.my/isms_scheduler.php? un=exabytes&pwd=exabytes123&dstno=60123456789 &msg=Hello%20World&det=Task1&tr=onetime &type=1&sendid=12345&date=2020-01-28&hour=08 &min=15&week=1&month=1&day=1 |
System will return Scheduler ID after success. (Scheduler ID will use to Update and Delete)
List All Task Schedule via HTTPS: | https://smsportal.exabytes.my/isms_scheduler.php? un=exabytes&pwd=exabytes123&dstno=60123456789 &msg=Hello%20World&det=My%2Task &tr=onetime&type=1&sendid=12345&date=2020-01- 28&hour=08&min=15&week=1&month=1&day=1&scid=98765&action=update |
List All Task Schedule via HTTPS: | https://smsportal.exabytes.my/isms_scheduler.php? un=exabytes&pwd=exabytes123&scid=98765&action=delete |
===================================================================================
Methods of Sending SMS
Send SMS with ASP
This guide is a guide provided by our Exabytes Malaysia Team. You will be given information on
how to add SMS functionality to your website and how to send SMS with ASP code. This method
uses HTTP communication between the SMS Gateway and your website. To send and receive
SMS messages from a webpage, you will need to have scripting support enabled on your webserver.
Below are some examples using ASP scripting:
Integrate our SMS API into your ASP.NET application and enjoy our SMS services.
1. Register an account from Exabytes Bulk SMS Marketing Solutions.
2. Now you are ready.
Create a file called api_post.php in your host and paste the code below:
<% type = 1 sendid = 123456 message = "Hello this is a test message"
message = Server.urlencode(message)
from = "SMS"
address = "https://smsportal.exabytes.my/isms_send.php" uname = "yourusername"
pword = "yourpassword"
selectednums = "yournumber"
url =
address & "?un=" & uname &
"&pwd=" & pword &
"&msg=" & message &_
"&from=" & from & "
&dstno=" & selectednums &
"&type=" & type &_
"&sendid=" & sendid
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
msg = xmlhttp.responseText
response.write(msg)
set xmlhttp = nothing
%>
Send SMS with Java
Java is popular programming language and it can be used to develop many applications and solutions.
To be able to send SMS messages, its capabilities need to be extended to communicate with mobile
networks through Exabytes gateway.
Below, you can go through the scripts and API keys used to send SMS using Java.
1. Register an account from Exabytes Bulk SMS Marketing Solutions.
2. Now you are ready.
The phone number parameter can be comma separated value, for instance "0123456789,0134567890".
For sending to one recipient, pass the phone no as "01234567890"
1. Change the un (username)
2. Change pwd (password) with your username and password
3. Change the dstno (destination number) to your destination number with full country code
import java.io.*; import java.net.*;
public class exabytes { public static void main(String[] args)
throws Exception {
try {
String user = "isms"; //user isms username
String pass = "isms"; //user isms password
String dstno = "6016xxxxxxx"; //You are going compose a message to this destination number.
String str = "你好吗?"; //Your message over here
String msg = str.replace(" ", "%20");
int type = 2; //for unicode change to 2, normal will the 1.
String sendid = "exabytes"; //Malaysia does not support sender id yet.
// Send data
URL myUrl = new URL("https://smsportal.exabytes.my/isms_send.php?un=" + user +
"&pwd=" + pass
+ "&dstno=" + dstno + "&msg=" + msg + "&type=" + type + "&sendid=" + sendid);
URLConnection conn =myUrl.openConnection();
conn.setDoOutput(true);
// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
// Print the response output...
System.out.println(line);
}
rd.close();
System.out.println(myUrl); } catch (Exception e) {
e.printStackTrace();
}
}
}
Send SMS with C++
You can send SMS from C++ using compilers such as Code Block or Visual Studio.
Below are some parameters you will need to change.
1. Change the un (username)
2. Change pwd (password) with your username and password
3. Change the dstno (destination number) to your destination number with full country code
#include #include int main ()
{
HINSTANCE result;
result=ShellExecute(NULL,NULL,"https://smsportal.exabytes.my/isms_send.php?un=xxxxx &pwd=xxx&dstno=xxxxxxxxxxx&msg=xxxxxx&type=1&sendid=xxxxx",
NULL,NULL,SW_SHOWDEFAULT);
if ((int)result<=32)
std::cout << "Error!\nReturn value: " << (int)result << "\n"; return 0;
}
Send SMS with C#
This guide is a guide provided by our Exabtyes Team. You will be given information on how to add
SMS functionality to your website and how to send sms with C# code. This method uses HTTP
communication between the SMS Gateway and your website. To send and receive SMS messages
from a webpage, you will need to have scripting support enabled on your webserver. Below are
some examples using C# scripting.
1. Register an account from Exabytes Bulk SMS Marketing Solutions.
2. Now you are ready.
using System; using System.Collections.Generic; using System.ComponentModel;
using System.Data; using System.Drawing; using System.Linq; using System.Text;
using System. Threading.Tasks; using System.Windows.Forms; using System.IO;
using System.Web; using System.Net;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{ public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
String message = HttpUtility.UrlEncode("Hello world!");
SendSMSToURL("https://smsportal.exabytes.my/isms_send.php?un=username&pwd=password& dstno=60123456789&msg=" + message + "&type=1&sendid=12345");
}
private string SendSMSToURL(string getUri)
{
string SentResult = String.Empty;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(getUri);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader responseReader = new
StreamReader(response.GetResponseStream());
String resultmsg = responseReader.ReadToEnd(); responseReader.Close();
int StartIndex = 0;
int LastIndex = resultmsg.Length;
if (LastIndex > 0)
SentResult = resultmsg.Substring(StartIndex, LastIndex);
responseReader.Dispose();
return SentResult;
}
}
}
Send SMS with PHP
This guide is a guide provided by our Exabytes Malaysia Team. You will be given information on how
to add SMS functionality to your website and how to send SMS with PHP code. This method uses
HTTP communication between the SMS Gateway and your website. To send and receive SMS
messages from a webpage, you will need to have scripting support enabled on your webserver.
The scripting support can be PHP. Below are some examples using PHP scripting.
1. Register an account from Exabytes Bulk SMS Marketing Solutions.
2. Now you are ready.
Create a file called api_post.php in your host and paste the code below.
(Make sure you had installed PHP CURL)
<?php
//We create our own function to submit our link
//Certain hosts do not support the usage of "fopen"
function ismscURL($link){
$http = curl_init($link);
curl_setopt($http, CURLOPT_RETURNTRANSFER, TRUE);
$http_result = curl_exec($http);
$http_status = curl_getinfo($http, CURLINFO_HTTP_CODE); curl_close($http);
return $http_result;
}
if(isset($_POST["submit"])){
$destination = urlencode($_POST["dest"]);
$message = $_POST["msg"];
$message = html_entity_decode($message, ENT_QUOTES, 'utf-8');
$message = urlencode($message);
$username = urlencode("xxx");
$password = urlencode("xxx");
$sender_id = urlencode("66300");
$type = (int)$_POST['type'];
$fp = "https://smsportal.exabytes.my/isms_send.php";
$fp =
"?un=$username&pwd=$password&dstno=$destination&msg=$message&type=
$type&sendid=$sen der_id";
//echo $fp;
$result = ismscURL($fp);
echo $result;
}
?>
<html>
<head>
<title>API Sample</title>
<meta http-equiv="Content-Type" content="utf-8">
</head>
<body>
<form method="post" action="api_post.php">
Destination: <input name="dest" type="text"><br>
Message: <textarea name="msg" rows="10"></textarea><br>
Type: <input type="radio" name="type" value="1" checked>
ASCII <input type="radio" name="type" value="2"> Unicode<br>
<input type="submit" name="submit" value="Send">
</form>
</body>
</html>
Send SMS with VB.net
This guide is a guide provided by our Exabytes Malaysia Team. You will be given information on how
to add SMS functionality to your website and how to send sms with VB.NET code. This method uses
HTTP communication between the SMS Gateway and your website. To send and receive SMS messages
from a webpage, you will need to have scripting support enabled on your webserver. Below are some
examples using VB.NET scripting.
1. Register an account from Exabytes Bulk SMS Marketing Solutions.
2. Now you are ready.
Create a file called api_post.php in your host and paste the code below.
Private Function SendSMS(ByVal Test As Boolean, _
ByVal From As String, _
ByVal Type As String, _ ByVal Message As String, _ ByVal SendTo As String, _
ByVal URL As String) As String
Const TransportURL As String =" https://smsportal.exabytes.my/isms_send.php"
Const TransportUserNameAs String ="myusername"
Const TransportPasswordAs String ="mypassword"
Const TransportVerboseAs Boolean =True
Dim strPost As String
strPost = "un=" + TransportUserName _
+ "&pwd=" + TransportPassword _
+ "&msg=" + System.Web.HttpUtility.UrlEncode(Message) _
+ "&sendid=" + From _
+ "&type=" + Type _
+ "&dstno=" + SendTo
Dim request As WebRequest = WebRequest.Create(TransportURL)
request.Method = "GET"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
request.ContentType = "application/x-www-form-urlencoded"
request.ContentLength = byteArray.Length
Dim dataStream As Stream = request.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim response As WebResponse = request.GetResponse()
dataStream = response.GetResponseStream()
Dim reader As New StreamReader(dataStream)
Dim responseFromServerAs String = reader.ReadToEnd()
reader.Close() dataStream.Close() response.Close()
If responseFromServer.Length > 0 Then
Return responseFromServer
Else
Return CType(response, HttpWebResponse).StatusDescription
End If
End Function
===================================================================================
Function of Bulk SMS Task Scheduler
How to create Bulk SMS Task Scheduler with PHP code
1. Register an account from Exabytes Bulk SMS Marketing Solutions.
2. Creating PHP file.
Create a PHP file with the file name below. You may use any file name. It is advisable to create a
without any empty spacing in the name.
3. Bulk SMS API Scheduler PHP Coding
<?php
$username = "exabytes";
$password = "exabytes";
$dstno = 6016xxxxxxx;
$msg = "text message over here";
$det = "TEST";
$tr = "weekly";
$type = 1;
$senderid = "exabytes";
$date = "2013-06-16";
$hour = 12;
$min = 45;
$week = 1;
$month = 1;
$day = 1;
$sendlink =
"https://smsportal.exabytes.my/isms_scheduler.php?un=".urlencode($username)."&pwd=" .urlencode($password)."&dstno=".$dstno."&msg=".urlencode($msg)."&det=".
urlencode($det)."&tr=".$tr."&type=".$type."&sendid=".urlencode($senderid)."&date=".
$date."&hour=".$hour."&min=".
$min."&week=".$week."&month=".$month."&day=".$day;
$handle = fopen($sendlink, "r");
if ($handle) { while (($buffer = fgets($handle, 4096)) !== false)
{ echo "This is your task scheduler ID :" .$buffer;
} if (!feof($handle)) { echo "Error: unexpected fgets() fail\n";
} fclose($handle);
}
?>
After running the PHP file, a HTTP request will be initated and the browser address bar will
displayed the address as below:
https://smsportal.exabytes.my/isms_scheduler.php?un=exabytes&pwd=
exabytes&dstno=601xxxxxx&msg=hello&det=TEST&tr=onetime&type=1&sen did=exabytes&date=
2013-06-14&hour=08&min=15&week=1&month=1&day=1
4. It works! The task scheduler is created.
How to Update Bulk SMS Task Scheduler With PHP Code
Besides creating Bulk SMS Task Scheduler using PHP, you can also update the task using similar methods.
1. Register an account from Exabytes Bulk SMS Marketing Solutions.
2. Integrate Bulk SMS Task Scheduler PHP code into PHP file.
After retrieving the SCID, go to your PHP file and add in the code, as shown in the illustration below.
<?php
$username = "exabytes";
$password = "exabytes123";
$dstno = 601xxxxxxx;
$msg = "testing message";
$det = "description";
$tr = "onetime";
$type = 1;
$senderid = "exabytes";
$date = "2013-12-12";
$hour = 12;
$min = 15;
$week = 1;
$month = 1;
$day = 1;
$scid = 12345 ; //scid get from the task scheduler you created
$action = "update";
$sendlink="https://smsportal.exabytes.my/isms_scheduler.php?un=".urlencode($usernam
e)."&pwd=".urlencode($password)."&dstno="
.$dstno."&msg=".urlencode($msg)."&det=".urlencode($det)."&tr=".$tr."&type=".$type." &sendid="
.urlencode($senderid)."&date=".$date."&hour=".$hour."&min=".$min."&week=".$week."&m onth="
.$month."&day=".$day."&scid=".$scid."&action=".$action; fopen($sendlink, "r");
?>
After SCID is amended, you can run the PHP file. A HTTP request will be initiated and the
browser address bar.
3. It works! Bulk SMS API Task Scheduler is amended.
As you you log in again to check your bulk SMS task scheduler, the trigger and details has changed.
This means you have successfully updated the task.
How to Delete Bulk SMS Task Scheduler with PHP Code
Delete task scheduler requires similar methods as updating task scheduler. You will need the
SDID to delete the specific task that is created.
1. Register an account from Exabytes Bulk SMS Marketing Solutions.
2. Delete bulk SMS task scheduler PHP coding.
Add the PHP code below into your PHP file.
<?php
$username = "exabytes";
$password = "exabytes";
$scid = 56442;
$action = "delete";
$sendlink =
"https://smsportal.exabytes.my/isms_scheduler.php?un=".urlencode($username)."&pwd="
.urlencode($password)."&scid=".$scid."&action=".$action; fopen($sendlink, "r");
?>
3. Success! The bulk SMS task scheduler is deleted.
After SCID is amended, you can run the PHP file in your browser.
A HTTP request will be initated and the browser address bar will displayed the address as below.
https://smsportal.exabytes.my/isms_scheduler.php?un =
exabytes&pwd=exabytes&scid=123456&action=delete
If you login to your Exabytes Bulk SMS account, you will find that the task scheduler has been deleted
from the SMS system.
REST API
1. Register an account from Exabytes Bulk SMS Marketing Solutions.
2. Now you are ready.
<?php
$username = 'yourusername';
$password = 'yourpassword';
$data = array (
'sendid' => 'Exabytes',
'recipient' => array
(
array('dstno' => '6012345678, 'msg' => 'Hello Exabytes', 'type' => '1')
),
'agreedterm' => 'YES',
'method' => 'isms_send_all_id'
);
$payload = json_encode($data);
$ch = curl_init('https://smsportal.exabytes.my//RESTAPI.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$headers = array(
'Content-Type: application/json',
'Authorization: Basic '. base64_encode("$username:$password"),
'Content-Length: ' . strlen($payload)
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
curl_close($ch);
?>