Benefits of using our Message Gateway and HTTP Post API
• Send SMS Messages Directly From Your Applications or Website
Send texts to an individual or multiple recipients directly from your server.
• Receive SMS Messages Directly To Your Server
Whether you have a Short Code, Shared or Dedicated Inbound Number all inbound texts will be forwarded directly onto 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.
HTTP URLs: http://SMSAPI.Wire2Air.com/smsadmin/submitsm.aspx
HTTP METHOD: POST or GET
HTTP Form Variables
| Name |
Description |
|
*VERSION |
2.0 |
|
*USERID |
YOUR_USERID; PROVIDED BY WIRE2AIR |
|
*PASSWORD |
YOUR_PASSWORD; PROVIDED BY WIRE2AIR |
|
*VASID |
YOUR_VASID; PROVIDED BY WIRE2AIR |
|
*PROFILEID |
YOUR_PROFILEID; 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) |
|
NETWORKID |
Optional
Network ID of destination network,
Wire2Air use internal networkid to identify the carriers, Supported Networks
These are the same networkid passed from our HTTP API when receiving incoming SMS. |
|
DeliveryDateTime (optional) |
Optional
Default: Now
Date and time for message delivery in UTC format. Example:
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
e.g http://[your_server]/smsreceiver? |
Response from Send SMS APIs
The API will return a string message to the calling application.
Successful submission:
JOBID: [MOBILENUMBER]:[SMSID]
Failed submission:
ERR: 301: Failed authentication
ERR: 305: Not enough credits
API usage example from PHP, ASP, & C#:
PHP:
<?php
$ch = curl_init(http://smsapi.Wire2Air.com/smsadmin/submitsm.aspx');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, " VERSION=2.0&userid=[username]&password=[userpassword]&VASId=[VASId]& PROFILEID =[ PROFILEID ]& FROM =27126&TO=[Mobile Number]&Text=[Text Message]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$data = curl_exec($ch);
Print($data); /* result of API call*/
?>
C#
string ret=string.Empty;
WebRequest w=WebRequest.Create("http://smsapi.Wire2Air.com/smsadmin/submitsm.aspx");
w.Method="POST";
w.ContentType="application/x-www-form-urlencoded";
using(Stream writeStream = w.GetRequestStream())
{
UTF8Encoding encoding = new UTF8Encoding();
byte[] bytes = encoding.GetBytes("VERSION=2.0&userid=[username]&password=[userpassword]&VASId=[VASId] & PROFILEID =[ PROFILEID ]& FROM =27126&TO=[Mobile Number]&Text=[Text Message]);
writeStream.Write(bytes, 0, bytes.Length);
}
using (HttpWebResponse r = (HttpWebResponse) w.GetResponse())
{
using (Stream responseStream = r.GetResponseStream())
{
using (StreamReader readStream = new StreamReader (responseStream, Encoding.UTF8))
{
ret = readStream.ReadToEnd();
}
}
}
MessageBox.Show(ret); /* result of API call*/
ASP:
sstrData = "version=2.0"
sstrData = "To=" & [Mobile Number]
sstrData = sstrData + "&From=27126"
sstrData = sstrData + "&UserId=XXXXX"
SstrData = sstrData + "&Password=XXXXX"
SstrData = sstrData + "&vasid=XXXX"
SstrData = sstrData + "&networkid=44"
SstrData = sstrData + "&profileid=2"
SstrData = sstrData + "&Text=Demo Message"
Set myhttp=CreateObject ("Msxml2.XMLHTTP")
Myhttp.open ("POST", "http://smsapi.Wire2Air.com/smsadmin/submitsm.aspx", false)
Myhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
Myhttp.send sstrData
Response.write myhttp.responsetext
Set myhttp = Nothing
Receive SMS/Text Messages from Wire2Air Gateway API:
How it works?
STEP1: User sends a text message to an assigned shortcode.
STEP2: Message received by z 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.
HTTP URLS
http://[client web service url]?
MobileNumber=xxxxxxxx&Operatorid=110&Message=xxxxxxx&SMSINBOXID=388&shortcode=xxxx
Operatorid: To be used as NETWORKID in Send API
HTTP METHOD
GET
Parameters
MobileNumber: User's mobile number
Operatorid: Networkid of destination network, Wire2Air use internal networkid to identify the networks, LIST ANNEX 1A
Message: Text Message sent by user
Rcvd: Message received date & time
SMSInboxid: Reference number for all incoming messages
Network Identifications for North America (Operatorid)
| Network Name |
ID |
|
Boost |
600 |
|
Verizon |
11 |
|
AT&T |
44 |
|
SPRINT |
455 |
|
ALLTEL |
18 |
|
T-MOBILE |
470 |
|
Cellular One |
168 |
|
Nextel |
353 |
|
Virgin |
601 |
|
US Cellular |
602 |
|