SMS Documentation

High Performance SMS

  • High throughput ( up to 200 msgs/second )
  • Direct and continuous connection to our SMS platform
  • DLR
Example URL Request to send SMS
https://api.quiubas.com:9443/api?action=sendmessage&username=demouser&password=mypassword123&recipient=16502952753&messagedata=test%20quiubas%20sms&responseformat=xml

Example XML Response
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 246
<response> <action>sendmessage </action> <data> <acceptreport> <statuscode>0 </statuscode> <statusmessage>Message accepted for delivery</statusmessage> <messageid>d4599171-0e3f-4ffd-85f2-151694b945bf</messageid> <recipient>16502952753</recipient> </acceptreport> </data> </response>
Example HTML Response
Status code: 0 Status message: Message accepted for delivery Message ID: d4599171-0e3f-4ffd-85f2-151694b945bf Recipient: 16502952753
Example of PHP script used to send SMS
<?php ######################################################## # Create variables with your Quiubas! SMS API credentials ######################################################## $myQ_APIuser = "sampleAPIuser"; $myQ_APIpassword = "mysuppersecurepassword"; $quiubas_api = "https://api.quiubas.com:9443/api?"; ######################################################## # Functions used to send the SMS message ######################################################## function httpRequest($url){ $pattern = "/http...([0-9a-zA-Z-.]*).([0-9]*).(.*)/"; preg_match($pattern,$url,$args); $in = ""; $fp = fsockopen("$args[1]", $args[2], $errno, $errstr, 30); if (!$fp) { return("$errstr ($errno)"); } else { $out = "GET /$args[3] HTTP/1.1\r\n"; $out .= "Host: $args[1]:$args[2]\r\n"; $out .= "User-agent: Ozeki PHP client\r\n"; $out .= "Accept: */*\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $in.=fgets($fp, 128); } } fclose($fp); return($in); } function sendSMS($phone, $msg, $debug=false){ global $myQ_APIuser,$myQ_APIpassword,$quiubas_api; $url = 'username='.$myQ_APIuser; $url.= '&password='.$myQ_APIpassword; $url.= '&action=sendmessage'; $url.= '&messagetype=SMS:TEXT'; $url.= '&recipient='.urlencode($phone); $url.= '&messagedata='.urlencode($msg); $urltouse = $quiubas_api.$url; if ($debug) { echo "Request: <br>$urltouse<br><br>"; } //Open the URL to send the message $response = httpRequest($urltouse); if ($debug) { echo "Response: <br><pre>". str_replace(array("<",">"),array("<",">"),$response). "</pre><br>"; } return($response); } ######################################################## # Form values from an HTML form containing SMS data to be sent ######################################################## $recipient = $_POST['recipient']; $messagedata = $_POST['message']; $debug = true; sendSMS($recipient,$messagedata,$debug); ?>
Example of ASP script used to send SMS
######################################################## # Simple form to submit data to send as an SMS ######################################################## <form method="post" action=""> <table align="center"> <tr> <td colspan="2" align="center"> <b>Send an SMS message</b> <br><br> </td> </tr> <tr> <td> Recipient: </td> <td> <input type="text" name="recipient" value= "<%response.write(Request.form("recipient"))%>" size="40"> </td> </tr> <tr> <td valign="top"> Message text: </td> <td> <textarea name="messagedata" rows="3" cols="40"> <%response.write(Request.form("messagedata"))%></textarea> </td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" value="Send"> </td> </tr> <tr> <td colspan="2" align="center"> <% ... 'Sending... %> </td> </tr> </table> </form> ######################################################## # Processing data coming from HTML form ######################################################## <form method="post" action=""> <table align="center"> ... <tr> <td colspan="2" align="center"> <% if Request.form("recipient") = "" then response.write("<font color='red'>Recipient 'Recipient is required</font>") else dim createdURL createdURL = "" 'full URL to connect to Quiubas! SMS API dim quiubasAPIURL quiubasAPIURL = "http://api.quiubas.com" 'Quiubas! SMS API URL dim quiubasAPIPort quiubasAPIPort = "9501" 'Port number of the Quiubas! SMS API dim myQ_APIuser myQ_APIuser = server.URLEncode("sampleAPIuser") 'Your API username dim myQ_APIpassword myQ_APIpassword = server.URLEncode("mysupersecurepassword") 'Your API password dim mySMSType mySMSType = "SMS:TEXT" 'Type of message that we want to send dim myRecipient myRecipient = server.URLEncode(Request.form("recipient")) 'SMS Recipient dim myMessageData ozMessageData = server.URLEncode(Request.form("messagedata")) 'SMS Message to send createdURL = quiubasAPIURL & ":" & quiubasAPIPort & "/httpapi?action=sendMessage" & "&username=" & myQ_APIuser & "&password=" & myQ_APIpassword & "&messageType=" & mySMSType & "&recipient=" & myRecipient & "&messageData=" & myMessageData response.Write("<iframe src=" & createdURL & " width='500'>") end if %> </td> </tr> </table> </form>
Please contact support@quiubas.com
Example of an AJAX call to send SMS
<html> <head> <title>Simple HTML SMS form</title> <script src="quiubasajax.js"></script> </head> <body> <form> <table align="center"> <tr> <td colspan="2" align="center"> <b>Compose a message</b> <br><br> </td> </tr> <tr> <td> Recipient: </td> <td> <input type="text" id="recipient" name="recipient" size="40"> </td> </tr> <tr> <td valign="top"> Message text: </td> <td> <textarea id="messagetext" name="messagetext" rows="3" cols="40"></textarea> </td> </tr> <tr> <td colspan="2" align="center"> <img src="send.gif" onclick="sendSMSRequest();"> </td> </tr> <tr> <td colspan="2" align="center"> <br /><div id="responseText" name="responseText" style="color:red;"></div> </td> </tr> </table> </form> </body> </html> ######################################################## # Process data from HTML form ######################################################## function GetXmlHttpObject() { var xmlHttp = null; try { // Firefox, Opera 8.0+, Safari xmlHttp = new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } ######################################################## # quiubasajax.js ######################################################## function sendSMSRequest() { xmlHttp = GetXmlHttpObject(); //create the object with which we will send //the request and receive the response if (xmlHttp == null) { alert ("AJAX is not supported!"); return; } if (document.getElementById("recipient").value == "") {//we must fill in field recipient! document.getElementById("responseText").innerHTML = ""; alert ("Recipient cannot be empty!"); return; } var createdURL = ""; //Full URL to be sent to Quiubas! SMS API var parameters = ""; //...together with the parameters var quiubasAPIURL = "http://api.quiubas.com"; //Quiubas! SMS API URL var quiubasAPIPort = "9501"; //Port number on which Ozeki NG SMS Gateway Server is listening to var myQ_APIuser = encodeURIComponent("mysampleuser"); //your API user var myQ_APIpassword = encodeURIComponent("mysupersecurepassword"); //your password var mySMSType = "SMS:TEXT"; //type of the message var myRecipient = encodeURIComponent(document.getElementById("recipient").value); // SMS recipient var myMessageData = encodeURIComponent(document.getElementById("messagetext").value); // SMS message content //Last step before sending the SMS, we form the full URL to submit to Quiubas! SMS API createdURL = quiubasAPIURL + ":" + quiubasAPIPort + "/httpapi"; parameters = "action=sendMessage" + "&username=" + myQ_APIuser + "&password=" + myQ_APIpassword + "&messageType=" + mySMSType + "&recipient=" + myRecipient + "&messageData=" + myMessageData; ... } ######################################################## # Send request to Quiubas! SMS API. quiubasajax.js ######################################################## function sendSMSRequest() { xmlHttp = GetXmlHttpObject(); //create the object to send and receive the request to try { xmlHttp.onreadystatechange = showResponse; //set property onreadystatechange //so that function runs as soon as response is received if (navigator.appName == "Netscape") { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert(e); } } xmlHttp.open("POST", createdURL, true); //if communication between our client and the server is slow, we inform the user about //we are doing something: document.getElementById("responseText").innerHTML = "Request is processing..."; xmlHttp.send(parameters); //we send the request } catch(e) { if (navigator.appName == "Netscape") { alert(e); } else { alert(e.description); } } } ######################################################## # As soon as the state of the xmlHttp object changes, showResponse() function will be trigered. When state is 4, it means that the request is completed. Whenever the xmlHttp.responseText is empty, it means that Quiubas! SMS API platform cannot be reached, otherwise the response text will be written. #quiubasajax.js ######################################################## function showResponse() { if (xmlHttp.readyState == 4) {//state 4 means request is complete if (xmlHttp.responseText == "") {//if response text is empty, Quiubas! server cannot be reached document.getElementById("responseText").innerHTML = "Failed to connect to Quiubas! SMS API"; } else {//the response text on div responseText will be written document.getElementById("responseText").innerHTML = xmlHttp.responseText; } } }
Example of JAVA script used to send SMS via HTML
import java.net.*; public class Java_example_httprequest { public static void main(String[] args) { try { String recipient = "16502952641"; String message = "Hello from Quiubas"; String username = "myuser"; String password = "mysupersecurepassword"; String sender = "1650650650"; String requestUrl = "https://api.quiubas.com:9443/api?action=sendmessage&" + "username=" + URLEncoder.encode(username, "UTF-8") + "&password=" + URLEncoder.encode(password, "UTF-8") + "&recipient=" + URLEncoder.encode(recipient, "UTF-8") + "&messagetype=SMS:TEXT" + "&messagedata=" + URLEncoder.encode(message, "UTF-8") + "&sender=" + URLEncoder.encode(sender, "UTF-8") + "&responseformat=xml"; URL url = new URL(requestUrl); HttpURLConnection uc = (HttpURLConnection)url.openConnection(); System.out.println(uc.getResponseMessage()); uc.disconnect(); } catch(Exception ex) { System.out.println(ex.getMessage()); } } }
Example of VB .NET script used to send SMS via HTTP
######################################################## # Connection variables to Quiubas SMS API ######################################################## Imports System Imports System.IO Imports System.Net Imports System.Text Imports System.Web Public Class fMain Private Sub bSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bSend.Click Dim request As HttpWebRequest Dim response As HttpWebResponse = Nothing Dim url As String Dim username As String Dim password As String Dim host As String Dim originator As String Try host = "http://api.quiubas.com:9501" originator = "524777640681" username = "myapiuser" password = "supersecurepassword" url = host + "/api?action=sendmessage&" _ & "username=" & HttpUtility.UrlEncode(username) _ & "&password=" + HttpUtility.UrlEncode(password) _ & "&recipient=" + HttpUtility.UrlEncode(tbReceiver.Text) _ & "&messagetype=SMS:TEXT" _ & "&messagedata=" + HttpUtility.UrlEncode(tbMessage.Text) _ & "&originator=" + HttpUtility.UrlEncode(originator) _ & "&responseformat=xml" request = DirectCast(WebRequest.Create(url), HttpWebRequest) response = DirectCast(request.GetResponse(), HttpWebResponse) MessageBox.Show("Response: " & response.StatusDescription) Catch ex As Exception End Try End Sub End Class
Example of Coldfusion SMS API
######################################################## # HTML form to submit SMS ######################################################## <html> <body> <h1>Quiubas SMS API Example</h1><br> <form action="quiubasAPISMS.cfm"> <h4>Message</h4> Recipient:<input type="Text" name="recipient"><br> Message Content:<textarea rows=4 cols=40 name='msgcontent'></textarea><br> <input type="submit" value="Send SMS"> </form> </body> </html> ######################################################## # quiubasAPISMS.cfm ######################################################## <cfset myAPI="api.quiubas.com"> <cfset myusername="apisms"> <cfset mypassword="supersecurepassword"> <cfset smsstringAPI = "http://#myAPI#:9501/api?action=sendmessage&username=#myusername#&password= #mypassword#&recipient=#URLEncodedFormat(recipient)#&messagetype=SMS:TEXT&messagedata=#URLEncodedFormat(msgcontent)#"> <cfhttp url="#smsstringAPI#"> <cfoutput> #cfhttp.filecontent# </cfoutput>
Example of Pearl script SMS API
#!/usr/bin/perl use HTTP::Request; use LWP::UserAgent; use URI::Escape; ############################################### #Quiubas SMS API information ############################################### $host = "api.quiubas.com"; $port = "9501"; $username = "apiuser"; $password = "supersecurepassword"; $recipient = "524777640681"; $message = "Hello Quiubas"; ############################################### #We now create the final http request to send our SMS ############################################### $url = "http://" . $host; $url .= ":" . $port; $url .= "/api?action=sendmessage&"; $url .= "username=" . uri_escape($username); $url .= "&password=" . uri_escape($password); $url .= "&recipient=" . uri_escape($recipient); $url .= "&messagetype=SMS:TEXT"; $url .= "&messagedata=" . uri_escape($message); ################################################ #HTTP Request ################################################ $request = HTTP::Request->new(GET=>$url); $useragent = LWP::UserAgent->new; $response = $useragent->request($request); ################################################ #Quiubas API SMS response ################################################ if ($response->is_success) { print "1 Message sent" } else { print "There was an error sending your SMS, please verify information" }
Please contact support@quiubas.com
Example of Pearl script SMS API
#include<iostream> #include<sstream> #include<windows.h> #include<wininet.h> using namespace std; string encode(string url); int main(int argc, char** argv) { // Quiubas SMS API host and port. string host = "api.quiubas.com"; int port = 9501; // Username and password. string myusername = "apiuser"; string mypassword = "superpassword"; // Message string message = "Hello Quiubas"; // Originating phone number. string originator = "+524777640681"; // To send a message to multiple recipients, separate them with coma. "+000000000000,+000000000000,+000000000000" string recipient = "+00000000000"; // Preparing the HTTPRequest url stringstream url; url << "/api?action=sendmessage&username=" << encode(myusername); url << "&password=" << encode(mypassword); url << "&recipient=" << encode(recipient); url << "&messagetype=SMS:TEXT&messagedata=" << encode(message); url << "&originator=" << encode(originator); url << "&responseformat=xml"; // Socket. HINTERNET inet = InternetOpen("QuiubasSMSAPI", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); // Open connection and bind it to the socket. HINTERNET conn = InternetConnect(inet, host.c_str() , port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); // Open the HTTP request HINTERNET sess = HttpOpenRequest(conn, "GET", url.str().c_str(), "HTTP/1.1", NULL, NULL, INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_RELOAD, 0); // Check errors int error = GetLastError(); if(error == NO_ERROR) { // Send HTTP request. HttpSendRequest(sess, NULL, 0, NULL,0); // Receive HTTP response. int size = 1024; char *buffer = new char[size + 1]; DWORD read; int rsize = InternetReadFile(sess, (void *)buffer, size, &read); string s = buffer; s = s.substr(0, read); // Check statuscode int pos = s.find("<statuscode>0</statuscode>"); // If statuscode is 0, write "Message sent." to output // else write "Error." if(pos > 0) cout << "Message sent." << endl; else cout << "Error." << endl; } system("pause"); } // encoding converts characters that are not allowed in a URL into character-entity equivalent. string encode(string url) { char *hex = "0123456789abcdef"; stringstream s; for(unsigned int i = 0; i < url.length(); i++) { byte c = (char)url.c_str()[i]; if( ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') ){ s << c; } else { if(c == ' ') s << "%20"; else s << '%' << (hex[c >> 4]) << (hex[c & 15]); } } return s.str(); }
import urllib

###############################################

#Quiubas SMS API information

###############################################

host = "http://api.quiubas.com"

user_name = "apiuser"

user_password = "securepassword"

recipient = "524777640681"

message_data = "Hello Quiubas"

###############################################

#Making friendly http request

###############################################

http_req = host

http_req += ":9501/api?action=sendmessage&username="

http_req += urllib.quote(user_name)

http_req += "&password="

http_req += urllib.quote(user_password)

http_req += "&recipient="

http_req += urllib.quote(recipient)

http_req += "&messagetype=SMS:TEXT&messagedata="

http_req += urllib.quote(message_data)

################################################

#We now send the sms

################################################

get = urllib.urlopen(http_req)

req = get.read()

get.close()

################################################

#Verify http request response

################################################

if req.find("Message accepted for delivery") > 1:

    print "Message successfully sent"

else:

    print "There is an error with your request, please check your script"
					
Example of VB6 script used to send SMS via HTTP
############################################### #Create internet connection ############################################### 'This function opens an internet connection Private Declare Function InternetOpen Lib "wininet" Alias "InternetOpenA" _ (ByVal quiubasAgent As String, ByVal quiubasAccessType As Long, ByVal quiubasProxyName As String, _ ByVal quiubasProxyBypass As String, ByVal quiubasFlags As Long) As Long 'This function handles the closing of the internet connection Private Declare Function InternetCloseHandle Lib "wininet" (ByRef quiubasInet As Long) As Long 'Reads the response file of the retrieved file requested by HTTP Private Declare Function InternetReadFile Lib "wininet" _ (ByVal quiubasGetFile As Long, ByVal quiubasBuffer As String, ByVal quiubasNumBytesToRead As Long, quiubasNumberOfBytesRead As Long) As Integer 'Opens an URL via the internet connection Private Declare Function InternetOpenUrl Lib "wininet" Alias "InternetOpenUrlA" _ (ByVal quiubasInternetSession As Long, ByVal quiubasUrl As String, ByVal quiubasHeaders As String, _ ByVal quiubasHeadersLength As Long, ByVal quiubasFlags As Long, ByVal quiubasContext As Long) As Long ############################################### #HTTP request ############################################### Private Function SendRequest(ByVal strUrl As String) As String Dim quiubasConnOpen As Long, quiubasGetFile As Long Dim quiubasReturnValue As Long, quiubasBuffer As String * 128 Dim quiubasData As String quiubasConnOpen = InternetOpen("Quiubas API HTTP client", 1, vbNullString, vbNullString, 0) If quiubasConnOpen = 0 Then MsgBox "No Internet connection" Exit Function End If quiubasGetFile = InternetOpenUrl(quiubasConnOpen, strUrl, vbNullString, 0, &H4000000, 0) InternetReadFile quiubasGetFile, quiubasBuffer, 128, quiubasReturnValue quiubasData = quiubasBuffer Do While quiubasReturnValue <> 0 InternetReadFile quiubasGetFile, quiubasBuffer, 128, quiubasReturnValue quiubasData = quiubasData + Mid(quiubasBuffer, 1, quiubasReturnValue) Loop InternetCloseHandle quiubasGetFile InternetCloseHandle quiubasConnOpen SendRequest = quiubasData quiubasData = "" End Function ############################################### #fucntion to send the HTTP request ############################################### Private Sub Command1_Click() Dim quiubasIpaddr As String Dim quiubasPortNum As String Dim quiubasUser As String Dim quiubasPass As String Dim quiubasRecipient As String Dim quiubasMessage As String quiubasIpaddr = Text1.Text quiubasPortNum = Text2.Text quiubasUser = Text3.Text quiubasPass = Text4.Text quiubasRecipient = Text5.Text quiubasMessage = Text6.Text Dim SendString As String 'SendString variable will contain the HTTP GET string, which will be used to send the message. SendString = "http://" + quiubasIpaddr + ":" + quiubasPortNum _ & "/api?action=sendmessage&username=" + quiubasUser _ & "&password=" + quiubasPass _ & "&recipient=" + quiubasURLEncode(quiubasRecipient) _ & "&messagetype=SMS:TEXT&messagedata=" + quiubasURLEncode(quiubasMessage) 'Sending the SMS with the HTTP request, and writing the response xml to the frame Label7.Caption = SendRequest(SendString) End Sub
Example of TCL/TK to send SMS via HTTP
#!/usr/bin/tclsh package require http ############################################### # Functions to properly HTTP encoding ############################################### proc init {} { variable map variable alphanumeric a-zA-Z0-9 for {set i 0} {$i <= 256} {incr i} { set c [format %c $i] if {![string match \[$alphanumeric\] $c]} { set map($c) %[format %.2x $i] } } array set map { " " + \n %0d%0a } } proc url-encode {string} { variable map variable alphanumeric regsub -all \[^$alphanumeric\] $string {$map(&)} string regsub -all {[][{})\\]\)} $string {\\&} string return [subst -nocommand $string] } init ############################################### # Quiubas SMS API information ############################################### set host "api.quiubas.com" set port "9501" set username [url-encode "apiuser"] set password [url-encode "supersecurepassword"] set recipient [url-encode "524777640681"] set message [url-encode "Hello Quiubas"] ############################################### #All set for HTTP request ############################################### set url "http://$host:$port/api?action=sendmessage&username=$username &password=$password&recipient=$recipient&messagetype=SMS:TEXT&messagedata=$message" ################################################ #Send SMS ################################################ set http [::http::geturl $url] ################################################ #Check HTTP request response ################################################ upvar #0 $http state if {$state(http) == "HTTP/1.1 200 OK"} { puts "Message successfully sent\n" } else { puts "Message failed to send.\n" } exit

The most Powerful SMS Tool Available

  • Reach thousands of destinations with just one click
  • You can use Microsoft Excel© files to send bulk SMS
  • Store frequent recipients
  • View real-time reporting

Just choose the type of connection you need:

Set up an email address wherever you want (i.e. sms@yourdomain.com ) and provide your account manager with the email login credentials to configure the service. Quiubas will download new e-mails from the POP3 account and forward the first 160 characters located in the MESSAGE BODY to the phone number in the SUBJECT line.
Configure your preferred email client (Microsoft Outlook©, Apple Mail©, etc...) or application software to use Quiubas SMTP server for outgoing emails. Set-up your credentials.

Send email messages that will turn into SMS messages with a simple email address like 1000222888@smsservice.quiubas.com