Developer APIs

Text Message Developer SMS APIs

With the Wire2Air SMS API, you have access to powerful text messaging functionality for integration into your existing and new web and enterprise applications.

Send SMS Text messages using SMS API
Text Messaging API or SMS API can enable application to receive and send SMS text messages utilising Wire2Air advanced SMS gateway API or Text Messaging API. Wire2Air provides simple HTTP interface for clients to send and receive messages from mobile phone users. HTTP POST can be used in all modern programming languages including ASP, ASP.NET, C++, C#, PHP, VB, VB.NET, command lines, SSH & cURL.

Benefits of using our SMS Text Messaging Gateway and Text Messaging Post API

  • Send SMS Text Messages Directly From Your Applications or Website
    Send texts to an individual or multiple recipients directly from your server.
  • Receive SMS Text Messages Directly To Your Server
    Whether you have a Short Code, Shared or Dedicated Inbound Number all inbound texts will be forwarded directly to your server.
  • Easy and Immediate Implementation
    Implementation of the required code and integrating it with our system can all be done in less than 30 minutes.
  • No SMS/SMPP Gateway required to be installed on client site.
  • Sticky session; Once customer start using your server, stay in touch with them. Messages will be forwarded to your server even if keyword not included in message.
  • Supports Delivery Reports (Advance Developer API account
Send SMS Text Messages Via SMS API | Receive Messages Via SMS API Sending SMS Text Messages using HTTP SMS API
HTTP URL

http://smsapi.Wire2Air.com/smsadmin/submitsm.aspx

Example: http://smsapi.Wire2Air.com/smsadmin/submitsm.aspx?version=2.0&userid=USERID&password=PASSWORD &vasid=VASID&FROM=SHORTCODE&to=MOBILENUMER&text=YOUR_MESSAGE
HTTP METHOD:

POST or GET

HTTP Parameters
*VERSION 2.0
*USERID YOUR_USERID; PROVIDED BY Wire2Air
*PASSWORD YOUR_PASSWORD; PROVIDED BY Wire2Air
*VASID YOUR_VASID; PROVIDED BY Wire2Air
*FROM SHORT CODE NUMBER; PROVIDED BY Wire2Air
*TO DESTINATION MOBILE NUMBER. [(country code) + mobile number]
e.g 17220001111
*TEXT The Text Message (160 characters)
DeliveryDateTime (optional) Optional
Default: Now
Date and time for message delivery in UTC format.

Example: 07/14/1997 00:00:00;UTC date time
The following represents Sunday, July 13, 1997 at 8:00:00 PM in New York City.

ReplyPath** Your server application web address to receive replies from users
CASE BY case basis
ONLY available in advance developer API.
e.g http://[your_server]/smsreceiver?
RESPONSE FROM SERVER

After you submit the message request to Wire2Air server, the server will return a response in following format:

For successful submission:

JOBID: [MOBILENUMBER]:[SMSID]

Failed submission:

ERR: 301: Failed authentication
ERR: 305: Not enough credits

Note

  • Values must be properly URL encoded
  • Message submitted longer than 160 characters will be rejected. For sending messages longer than 160 characters, contact sales.
  • You’ll be charged one credit for every 160 character message.
  • The list of allowed characters for messages and subjects is: a-z, A-Z, 0-9 and these special characters: .,:;!?()~=+-_\/@$#&%'”
  • For line break in a message, use \r\n; e.g Your class is schedule on \r\n july 24th @ 7:00PM.
  • The following characters count as two characters: ~, @, #, %, +, =, /, \, \r\n

PHP:

01 02  $ch = curl_init(http://smsapi.Wire2Air.com/smsadmin/submitsm.aspx’);
03  curl_setopt($ch, CURLOPT_POST, 1);
04  curl_setopt($ch, CURLOPT_POSTFIELDS,”VERSION=2.0&userid=[username]&password=[userpassword]&VASId=[VASId]&PROFILEID=[PROFILEID]&FROM=27126&TO=[Mobile Number]&Text=[Text Message]);
05  curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
06  $data = curl_exec($ch);
07  Print($data); /* result of SMS API call*/
08 ?>

C#:

01  string ret=string.Empty;
02  WebRequest w=WebRequest.Create(“http://smsapi.Wire2Air.com/smsadmin/submitsm.aspx”);
03  w.Method=”POST”;
04  w.ContentType=”application/x-www-form-urlencoded”;
05  using(Stream writeStream = w.GetRequestStream())
06     {
07      UTF8Encoding encoding = new UTF8Encoding();
08      byte[] bytes = encoding.GetBytes(“VERSION=2.0&userid=[username]&password=[userpassword]&VASId=[VASId] & PROFILEID =[ PROFILEID ]& FROM =27126&TO=[Mobile Number]&Text=[Text Message]);
09      writeStream.Write(bytes, 0, bytes.Length);
10     }
11  using (HttpWebResponse r = (HttpWebResponse) w.GetResponse())
12      {
13     using (Stream responseStream = r.GetResponseStream())
14        {
15         using (StreamReader readStream = new StreamReader (responseStream, Encoding.UTF8))
16            {
17            ret = readStream.ReadToEnd();
18            }
19        }
20       }
21  MessageBox.Show(ret); /* result of API call*/

ASP:

01  sstrData = “version=2.0”
02  sstrData = “To=” & [Mobile Number]
03  sstrData = sstrData + “&From=27126”
04  sstrData = sstrData + “&UserId=XXXXX”
05  SstrData = sstrData + “&Password=XXXXX”
06  SstrData = sstrData + “&vasid=XXXX”
07  SstrData = sstrData + “&networkid=44”
08  SstrData = sstrData + “&profileid=2”
09  SstrData = sstrData + “&Text=Demo Message”
10  Set myhttp=CreateObject (“Msxml2.XMLHTTP”)
11  Myhttp.open (“POST”, “http://smsapi.Wire2Air.com/smsadmin/submitsm.aspx”, false)
12  Myhttp.setRequestHeader “Content-Type”, “application/x-www-form-urlencoded”
13  Myhttp.send sstrData
14  Response.write myhttp.responsetext
15  Set myhttp = Nothing

Receive SMS/Text Messages from SMS API/ SMS gateway developer API:

How it works?

  • STEP1: User sends a text message to an assigned shortcode.
  • STEP2: Message received by Wire2Air server from carrier.
  • STEP3: Wire2Air parses the message, and redirect to clients� server based on short code, and prefix assigned.
Requirements

Client should set a web service to receive messages from Wire2Air servers. Wire2Air will send a message to client server in the following format. When configured you can pickup values from our GET request in following way using PHP

PHP:

01

HTTP URLS

http://[client web service url]?
MobileNumber=xxxxxxxx&Message=xxxxxxx&SMSINBOXID=388&shortcode=xxxx

HTTP METHOD

GET

Parameters

MobileNumber: User’s mobile number

Message: Text Message sent by user

Rcvd: Message received date & time

SMSInboxid: Reference number for all incoming messages

© Copyright - Wire2Air SMS Service Provider. To unsubscribe from any Wire2Air list simply send 'STOP' to 27126 or contact support. Message and Data Rates May Apply.