Inbound SMS and MMS
Wire2Air forwards picture messages (and text) sent to your short code to your server as a GET request with the subject, the media location and the file names.
This webhook delivers MMS (picture messages) as well as SMS. Wire2Air receives the message from the carrier, matches it to your account by short code and keyword, and calls your URL.
https://your-server.example/wire2air/inbound-mmsParameters
| Parameter | In | Description |
|---|---|---|
| mobilenumber stringrequired in query | query | The sender's mobile number. |
| message stringoptional in query | query | Text the sender wrote. |
| rcvd stringrequired in query | query | When Wire2Air received the message. |
| shortcode stringrequired in query | query | Your short code the message was sent to. |
| subject stringoptional in query | query | The MMS subject. |
| baseurl stringoptional in query | query | Where the message's files are stored. Join it with each file name in attachments to download a file. |
| attachments stringoptional in query | query | Comma-separated file names. |
| keyword stringoptional in query | query | The keyword the message was sent with. Shown in the previous example request but not in its parameter list. |
An example request, URL-encoded:
GET /wire2air/inbound-mms?mobilenumber=12125551234&rcvd=1%2F1%2F2009%2003%3A00%3A00PM&shortcode=27126&subject=demo%20mms&baseurl=http%3A%2F%2Fmms.wire2air.com%2Fmms%2Fmmsinbox%2F&attachments=0.smil%2C1.jpg%2C2.txt&keyword=%40demomms HTTP/1.1
Host: your-server.example
Examples
<?php
// Wire2Air's casing is unconfirmed, so accept both spellings.
function param(string $lower, string $mixed): string
{
return $_GET[$lower] ?? $_GET[$mixed] ?? '';
}
$sender = param('mobilenumber', 'MobileNumber');
$subject = $_GET['subject'] ?? '';
$baseUrl = $_GET['baseurl'] ?? '';
$files = array_filter(array_map('trim', explode(',', $_GET['attachments'] ?? '')));
foreach ($files as $file) {
// Download each file from $baseUrl . $file and store it.
error_log('MMS file from ' . $sender . ': ' . $baseUrl . $file);
}
http_response_code(200);
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import parse_qs, urlparse
class InboundMms(BaseHTTPRequestHandler):
def do_GET(self):
params = parse_qs(urlparse(self.path).query)
def param(lower, mixed):
# Wire2Air's casing is unconfirmed, so accept both spellings.
values = params.get(lower) or params.get(mixed) or [""]
return values[0]
sender = param("mobilenumber", "MobileNumber")
base_url = params.get("baseurl", [""])[0]
files = [f.strip() for f in params.get("attachments", [""])[0].split(",") if f.strip()]
for name in files:
print(f"MMS file from {sender}: {base_url}{name}")
self.send_response(200)
self.end_headers()
HTTPServer(("", 8080), InboundMms).serve_forever()
import { createServer } from "node:http";
createServer((req, res) => {
const params = new URL(req.url, "http://localhost").searchParams;
// Wire2Air's casing is unconfirmed, so accept both spellings.
const param = (lower, mixed) => params.get(lower) ?? params.get(mixed) ?? "";
const sender = param("mobilenumber", "MobileNumber");
const baseUrl = params.get("baseurl") ?? "";
const files = (params.get("attachments") ?? "").split(",").map((f) => f.trim()).filter(Boolean);
for (const file of files) {
console.log(`MMS file from ${sender}: ${baseUrl}${file}`);
}
res.writeHead(200).end();
}).listen(8080);
// ASP.NET Core minimal API (.NET 6+, project SDK Microsoft.NET.Sdk.Web).
var app = WebApplication.CreateBuilder(args).Build();
app.MapGet("/wire2air/inbound-mms", (HttpRequest request) =>
{
// Query keys in ASP.NET Core are case-insensitive, so both spellings match.
var sender = request.Query["mobilenumber"].ToString();
var baseUrl = request.Query["baseurl"].ToString();
var files = request.Query["attachments"].ToString()
.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
foreach (var file in files)
{
app.Logger.LogInformation("MMS file from {Sender}: {Url}", sender, baseUrl + file);
}
return Results.Ok();
});
app.Run();

