Easy Non-Masking SMS API in Bangladesh

Send SMS from your software applications and websites with easy and simple SMS Gateway API. OTP, Account Verifications, Notifications & Reminders are some ways applications could utilize SMS Gateway and API. Alpha SMS API provides a powerful yet easy-to-send SMS Capability to your projects. Add SMS functionality to School Management Software, Small Business SMS marketing, ISP, Corporates & NGO in Bangladesh. For a Free Trial Account, please call us +88 09613 250 250 or contact us online.

How to Send SMS Through API

Alpha Non-Masking SMS API can be used by both GET and POST methods. You can send SMS from your software or application by integrating Alpha Non-Masking SMS API. Just follow the code samples below to send SMS API from your applications. To obtain your API Key, please log in to your SMS Panel & go to "My account" > "User configuration" you will get your API access token (Webservices token) here. Now you have to follow the instructions below:

API URL

http://alphasms.biz/index.php?app=ws

Send SMS (Example)

Example GET Method:

http://alphasms.biz/index.php?app=ws&u=username&h=a45a02791b2fe2fedb078c39fd83637a&op=pv&to=01979547393&msg=test+only

When succeeded Server will returns OK status message in JSON format:

{'data':[{'status':'OK','error':'0','smslog_id':'30','queue':'afb5f34575e30ec4efe4471cf5d1bee4','to':'01979547393'}],'error_string':null}

How to Send SMS Through API

We have included code samples for sending SMS in PHP, C#, ASP.Net, Android, VB.NET etc. Choose your choice of Language from the tabs below to view SMS API Code samples.

    

GET Method

$username = "YourUserNameHere"; $hash = "YourTokenCodeHere"; //generate token from the control panel $numbers = "017xxxxxxxx,018xxxxxxxx"; //Recipient Phone Number multiple number must be separated by comma $message = "Simple text message."; $params = array('app'=>'ws', 'u'=>$username, 'h'=>$hash, 'op'=>'pv', 'to'=>$numbers, 'msg'=>$message); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://alphasms.biz/index.php?".http_build_query($params, '', '&')); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type:application/json", "Accept:application/json")); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $response = curl_exec($ch); curl_close ($ch);
    

POST Method

$username = "YourUserNameHere"; $hash = "YourTokenCodeHere"; //generate token from the control panel $numbers = "017xxxxxxxx,018xxxxxxxx"; //Recipient Phone Number multiple number must be separated by comma $message = "Simple text message."; $params = array('u'=>$username, 'h'=>$hash, 'op'=>'pv', 'to'=>$numbers, 'msg'=>$message); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://alphasms.biz/index.php?app=ws"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $response = curl_exec($ch); curl_close ($ch);
                                              
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Net;
    using System.IO;

    namespace AlphaSMS{
        class Program{
            static void Main(string[] args){
            string result = "";
                WebRequest request = null;
                HttpWebResponse response = null;
                try{
                    String to = "016xxxxxxxx,017xxxxxxxx"; //Recipient Phone Number multiple number must be  separated by comma
                   String username = "YourUserNameHere"; //Your Username
                   String hash_token = "YourTokenCodeHere"; //generate token from the control panel
                   String message = System.Uri.EscapeUriString("my messages"); //do not use single quotation   (') in the message to avoid forbidden result
                   String url = "http://alphasms.biz/index.php?app=ws&op=pv&u=" + username + "&h=" + hash_token + "&to=" + to + "&msg=" + message;
                   request = WebRequest.Create(url);

                    // Send the 'HttpWebRequest' and wait for response.
                    response = (HttpWebResponse) request.GetResponse();
                    Stream stream = response.GetResponseStream();
                    Encoding ec = System.Text.Encoding.GetEncoding("utf-8");
                    StreamReader reader = new
                    System.IO.StreamReader(stream, ec);
                    result = reader.ReadToEnd();
                    Console.WriteLine(result);
                    reader.Close();
                    stream.Close();
                    } catch (Exception exp){
                    Console.WriteLine(exp.ToString());
                    } finally {
                    if (response != null)
                        response.Close();
                }
            }
        }
    }


               
                            
   <% 
        apiurl = "http://alphasms.biz/index.php?app=ws&op=pv"
		username = "YourUserNameHere"
        message = "Simple Text Message"
        message = Server.urlencode(message)
        numbers = "017xxxxxxxx,016xxxxxxxx"
        url = apiurl/index.html & "&u=" YourUserNameHere "&h=" & hashtoken & "&to=" & numbers & "&msg=" & message
        set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
        xmlhttp.open "GET", url, false
        xmlhttp.send ""
        msg = xmlhttp.responseText
        response.write(msg)
        set xmlhttp = nothing
    %>

               
    String username = "YourUserNameHere";
    String hash_token = "YourTokenCodeHere";

    //Single or Multiple mobiles numbers separated by comma
    String to = "017xxxxxxxxx,016xxxxxxxx";

    //Your message to send, Add URL encoding here.
    String textmessage = "my message is here";

    URLConnection myURLConnection=null;
    URL myURL=null;
    BufferedReader reader=null;

    //encode the message content
    String encoded_message=URLEncoder.encode(textmessage);
    String apiUrl="http://alphasms.biz/index.php?app=ws&op=pv";

    StringBuilder sgcPostContent= new StringBuilder(apiUrl);
    sgcPostContent.append("u="+username);
    sgcPostContent.append("h="+hash_token);
    sgcPostContent.append("&to="+to);
    sgcPostContent.append("&msg="+encoded_message);

    apiUrl = sgcPostContent.toString();
    try
    {
        //prepare connection
        myURL = new URL(apiUrl);
        myURLConnection = myURL.openConnection();
        myURLConnection.connect();
        reader= new BufferedReader(new InputStreamReader(myURLConnection.getInputStream()));

        //read the output
        String output;
        while ((output = reader.readLine()) != null)
        //print output
        Log.d("OUTPUT", ""+output);

        //Close connection
        reader.close();
    }
    catch (IOException e)
    {
        e.printStackTrace();
    }
    
               
    Imports System.Web
    Imports System.IO
    Imports System.Net
    Imports System.Text
    Imports System.Resources
    
    Public Class AlphaSMS
     
        Public Function AlphaSMS()
            Dim username = "YourUserNameHere"
            Dim hashtoken = "YourTokenCodeHere"
          
            Dim message = "Simple Text Message"
            Dim numbers = "017xxxxxxxx"
            Dim url As String = "http://alphasms.biz/index.php?app=ws&op=pv"
            Dim strPost As String
           
            strPost = url + "&u=" + username _
            + "&h=" + hashtoken _
            + "&to=" + numbers _
            + "&msg=" + WebUtility.UrlEncode(message) 
            
            Dim request As WebRequest = WebRequest.Create(strPost)
            request.Method = "POST"
            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 responseFromServer As String = reader.ReadToEnd()
            Console.WriteLine(responseFromServer)
            Console.ReadLine()
            
            reader.Close()
            dataStream.Close()
            response.Close()
            
            If responseFromServer.Length > 0 Then
                Return responseFromServer
            Else
                Return CType(response, HttpWebResponse).StatusDescription
            End If
        End Function
    End Class

               

Non Masking SMS API Parameters

Name Description
h Hash token, configured from User Configuration menus
u Username
op Operation or type of action (example: op=pv for Send SMS)
to Destination numbers, username or #groupcode, may use commas
nofooter Remove SMS footer (nofooter=1 will remove SMS footer.)
msg Message (+ or %20 for spaces, urlencode for non ascii chars)
schedule Schedule message delivery, format: YYYY-MM-DD hh:mm:ss
unicode Whether message unicode or not (1=unicode, 0=not unicode)

Non-Masking SMS Packages & Prices

Choose the right solution for your business. If you have any confusion to select packages, contact us. We will happy to help!

Basic
BDT0.27
Per SMS

Type: Non-Masking

Validity: 3 Month

Quantity: 5000 SMS

Total Price: BDT 1,350/-

Standard
BDT0.25
Per SMS

Type: Non-Masking

Validity: 6 Month

Quantity: 50,000 SMS

Total Price: BDT 12,500/-

Enterprise
BDT0.20
Per SMS

Type: Non-Masking

Validity: 12 Month

Quantity: 250,000 SMS

Total Price: BDT 50,000/-

We're Here to Help You

Have some questions? Chat with us now, or call us to get in touch.

Dedicated Number for your SMS Gateway

Send SMS through your Dedicated Number! Alpha SMS supports using a dedicated number for your bulk SMS. There is a one time setup fee of BDT 2,000/-. SMS cost for number is fixed BDT 0.25/- with a minimum initial purchase of 50,000 SMS.

dedicatednumberforyourbusiness

Question?

If you need help with selecting the right solution for your business, please call us at 09613-250250 within 9:00AM- 9:00PM or you can start a live chat. We are available 24/7 via live chat.

anyquestion