Skip to content
Wire2AirWire2Air

Inbound SMS

Wire2Air forwards each text sent to your short code to your server as a GET request with the sender, the message, the time and the short code.

Last updated

When someone texts your short code, Wire2Air receives the message from the carrier, works out which customer it belongs to from the short code and keyword, and calls your URL.

GEThttps://your-server.example/wire2air/inbound-sms
Credential
None. Wire2Air calls a URL on your server

Your URL. Wire2Air appends the parameters below as a query string.

Parameters

Parameters
ParameterDescription
MobileNumber
stringrequired
in query
The sender's mobile number.
Message
stringrequired
in query
The text the sender wrote.
Rcvd
stringrequired
in query
When Wire2Air received the message.
Example: 1-2-2015 02:18:30
shortcode
stringrequired
in query
Your number the message was sent to.
Example: 27126

An example request, URL-encoded:

Request from Wire2Air
GET /wire2air/inbound-sms?MobileNumber=12125551234&Message=Hello&Rcvd=1-2-2015%2002%3A18%3A30&shortcode=27126 HTTP/1.1
Host: your-server.example

Examples

<?php
// Read the values Wire2Air sends; validate them before you use them.
$sender = $_GET['MobileNumber'] ?? '';
$content = $_GET['Message'] ?? '';
$shortCode = $_GET['shortcode'] ?? '';
$received = $_GET['Rcvd'] ?? '';

// Store the message, then answer quickly.
error_log(sprintf('SMS from %s to %s at %s: %s', $sender, $shortCode, $received, $content));
http_response_code(200);

Replying

To answer the sender, send a message back to MobileNumber from the same shortcode.