SMS HTTP API

Merging Our Coding With Yours

Intro

SMS API or Text API can enable web applications to receive and send SMS text messages utilizing TXTImpact Text Message API.

TXTImpact provides simple HTTP SMS API interface for clients to send and receive text messages to 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.

The Benefits

  • Send SMS Text Messages Directly From Your Applications or Website Bulk Text Messaging: TXTImpact SMS API supports multiple outbound SMS text messaging with a single API request.

  • Two-way SMS: Receive SMS Text Messages Directly on Your Server using webhooks. Whether you have a Short Code, Shared or long code (virtual local 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.

  • 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 Handset Delivery Reports

  • Automatic Unicode characters handling

  • Bi-direction Long SMS Message support: Text Messages longer than 160 characters are automatically split and concatenated seamlessly on the user’s handset

  • No SMS/SMPP Gateway required to be installed on client site.
    Support HTTP and SMPP API

Send SMS Text Messages via SMS API | Receive Messages via SMS API

HTTP URL

https://msgapi.wire2air.com/smsapi/submitsm.aspx

HTTP METHOD

POST or GET

HTTP Parameters

Required Parameters

  • VERSION: 2.0
  • USERID: YOUR_USERID; PROVIDED BY TXTIMPACT
  • PASSWORD: YOUR_PASSWORD; PROVIDED BY TXTIMPACT
  • VASID: YOUR_VASID; PROVIDED BY TXTIMPACT
  • FROM: SHORT CODE NUMBER; PROVIDED BY TXTIMPACT
  • TO: DESTINATION MOBILE NUMBER. [(country code) + mobile number] e.g 17220001111
  • TEXT: The Text Message (160 characters)

Optional Parameters

DELIVERYDATETIME
  • 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. Default: Now, send immediately.

REPLYPATH

Your server application web address to receive replies from the users e.g http://[your_server]/smsreceiver?

RESPONSE FROM SERVER

After you submit the message request to TXTImpact 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

….

Example

http://msgapi.wire2air.com/smsapi/submitsm.aspx?version=2.0&userid=USERID&password=PASSWORD&vasid=VASID&FROM=SHORTCODE&to=MOBILENUMER&text=YOUR_MESSAGE

Note

  • Values must be properly URL encoded

  • 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

SMS API usage example from PHP, ASP, & C#:

  • PHP:

    <?php
    $ch = 
    curl_init(http://msgapi.wire2air.com/smsapi/submitsm.aspx');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,"VERSION=2.0&userid= [username]&password=[userpassword]&VASId=[VASId]&FROM=27126&TO=[Mobile Number]&Text=[Text Message]);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    $data = curl_exec($ch);
    Print($data); /* result of SMS 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] &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();18.            }
      }
     }
    MessageBox.Show(ret); /* result of API call*/
  • ASP:

    sstrData = "To=" & [Mobile Number]
    sstrData = sstrData + "&From=27126"
    sstrData = sstrData + "&UserId=XXXXX"
    SstrData = sstrData + "&Password=XXXXX"
    SstrData = sstrData + "&vasid=XXXX"
    SstrData = sstrData + "&Text=Demo Message"
    Set myhttp=CreateObject ("Msxml2.XMLHTTP")
    Myhttp.open("POST","http://msgapi.wire2air.com/smsapi/submitsm.aspx", false)
    Myhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    Myhttp.send sstrData
    Response.write myhttp.responsetext
    Set myhttp = Nothing

Receive SMS or Text Messages from users

  • Step 1: User sends a text message to an assigned short code or virtual phone number.

  • Step 2: Message received by TXTImpact server from the wireless carrier.

  • Step 3: TXTImpact parses the message, and redirect to clients’ server based on a shortcode, and prefix assigned.

Requirements:

Client should set-up a web service to receive messages from TXTImpact servers. TXTImpact 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:

<?php
$sender = $_REQUEST['MobileNumber'];
$content = $_REQUEST ['Message'];
$inNumber = $_REQUEST ['shortcode']; 
$Rcvd = $_REQUEST ['Rcvd'];
?>

HTTP URL’s

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 the user Rcvd: Message received date & time SMSInboxid: Reference number for all incoming messages

Video Tutorial

Discover other SMS APIs by TXTImpact

Elevate your reach with our Text Message SMS API, enabling seamless communication for your applications or servers worldwide.

Two-way Texting

Send text and receive replies to the text messages directly on your server using webhooks.

Unicode Support

Unicode character support to allow any language including Chinese, Arabic, and others plus emojis & symbols.

Extended Length SMS Support

Send messages longer than 160 characters as a single message. Long messages are automatically concatenated across global networks seamlessly.

Global Coverage

Send a text message to over 800 operators in over 200 countries and reach billions of mobile users.

MMS Developer API

Send and receive photos, videos and more. Support to send and receive picture messages and SMS using the same phone number.

Real Time Delivery Report

Receive real-time delivery reports of sent messages. Track delivery, link clicks and performance of your campaigns.

SMPP API

Connect with high throughout the SMPP interface to send and receive hundreds and thousands of messages.

Automatic Opt-out Handling

Out of the box opt-out handling. Replies such as "Stop", "Cancel" are automatically handled for you on any of your text numbers.

Number Pooling

Spread your messages across a pool of phone numbers to reach your users in time and improve delivery rate.

Sticky Number

Customers will receive messages from the same phone number.

Ready to get started?

Contact us or sign up for a free trial now.

By using this website you agree to our privacy policies

Cookie Settings

We use cookies to improve user experience. Choose what cookie categories you allow us to use. You can read more about our Cookie Policy by clicking on Cookie Policy below.

These cookies enable strictly necessary cookies for security, language support and verification of identity. These cookies can’t be disabled.

These cookies collect data to remember choices users make to improve and give a better user experience. Disabling can cause some parts of the site to not work properly.

These cookies help us to understand how visitors interact with our website, help us measure and analyze traffic to improve our service.

These cookies help us to better deliver marketing content and customized ads.