Send MMS
Send a picture message with the legacy HTTP API (submitmms.aspx). Wire2Air fetches the files from your server.
http://mms.wire2air.com/mms/submitmms.aspxSend one request per message. The MMS gateway downloads the files named in Attachments from BaseURL, so they must be reachable from the internet when you call it.
Parameters
| Parameter | In | Description |
|---|---|---|
| VERSION stringrequired in body | body | API version: 1.0. |
| USERID stringrequired in body | body | Your Wire2Air user ID. |
| PASSWORD stringrequired in body | body | Your Wire2Air password. |
| VASID stringrequired in body | body | Your VASID. |
| FROM stringrequired in body | body | The short code Wire2Air assigned to your account. |
| TO stringrequired in body | body | Destination mobile number with country code, for example 17321234567 (US) or 919810601000 (India). |
| Subject stringrequired in body | body | The MMS subject. |
| BaseURL stringrequired in body | body | The address where all the message's files can be found. Required unless you send MMSCode instead. |
| Attachments stringrequired in body | body | Comma-separated names of the files to include, fetched from BaseURL. Required unless you send MMSCode instead. |
| MMSCode stringoptional in body | body | Instead of BaseURL and Attachments: the code of a message in your Wire2Air MMS repository, or of an MMS you sent before (returned as MMSCODE). |
| DeliveryDateTime stringoptional in body | body | When to deliver, in UTC, as MM/DD/YYYY HH:MM:SS. See scheduling. |
Examples
curl "http://mms.wire2air.com/mms/submitmms.aspx" \
--data-urlencode "VERSION=1.0" \
--data-urlencode "USERID=YOUR_USERID" \
--data-urlencode "PASSWORD=YOUR_PASSWORD" \
--data-urlencode "VASID=YOUR_VASID" \
--data-urlencode "FROM=27126" \
--data-urlencode "TO=12121234567" \
--data-urlencode "Subject=Demo message" \
--data-urlencode "BaseURL=https://example.com/mms/" \
--data-urlencode "Attachments=logo.gif,offer.jpg"
import urllib.error
import urllib.parse
import urllib.request
params = urllib.parse.urlencode({
"VERSION": "1.0",
"USERID": "YOUR_USERID",
"PASSWORD": "YOUR_PASSWORD",
"VASID": "YOUR_VASID",
"FROM": "27126",
"TO": "12121234567",
"Subject": "Demo message",
"BaseURL": "https://example.com/mms/",
"Attachments": "logo.gif,offer.jpg",
})
request = urllib.request.Request(
"http://mms.wire2air.com/mms/submitmms.aspx",
data=params.encode("utf-8"),
method="POST",
)
try:
with urllib.request.urlopen(request, timeout=30) as response:
print(response.status, response.read().decode("utf-8"))
except urllib.error.HTTPError as error:
print(error.code, error.read().decode("utf-8"))
const params = new URLSearchParams({
VERSION: "1.0",
USERID: "YOUR_USERID",
PASSWORD: "YOUR_PASSWORD",
VASID: "YOUR_VASID",
FROM: "27126",
TO: "12121234567",
Subject: "Demo message",
BaseURL: "https://example.com/mms/",
Attachments: "logo.gif,offer.jpg",
});
const response = await fetch("http://mms.wire2air.com/mms/submitmms.aspx", {
method: "POST",
body: params, // sent as application/x-www-form-urlencoded
});
console.log(response.status, await response.text());
<?php
$params = http_build_query([
'VERSION' => '1.0',
'USERID' => 'YOUR_USERID',
'PASSWORD' => 'YOUR_PASSWORD',
'VASID' => 'YOUR_VASID',
'FROM' => '27126',
'TO' => '12121234567',
'Subject' => 'Demo message',
'BaseURL' => 'https://example.com/mms/',
'Attachments' => 'logo.gif,offer.jpg',
]);
$ch = curl_init('http://mms.wire2air.com/mms/submitmms.aspx');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $params,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
if ($body === false) {
echo 'Request failed: ' . curl_error($ch) . PHP_EOL;
} else {
echo curl_getinfo($ch, CURLINFO_HTTP_CODE) . ' ' . $body . PHP_EOL;
}
curl_close($ch);
using System;
using System.Collections.Generic;
using System.Net.Http;
var parameters = new Dictionary<string, string>
{
["VERSION"] = "1.0",
["USERID"] = "YOUR_USERID",
["PASSWORD"] = "YOUR_PASSWORD",
["VASID"] = "YOUR_VASID",
["FROM"] = "27126",
["TO"] = "12121234567",
["Subject"] = "Demo message",
["BaseURL"] = "https://example.com/mms/",
["Attachments"] = "logo.gif,offer.jpg",
};
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "http://mms.wire2air.com/mms/submitmms.aspx")
{
Content = new FormUrlEncodedContent(parameters),
};
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
Response
JOBID: [MOBILENUMBER]:[MMSID]:[MMSCODE]
Keep MMSCODE: you can send the same content again by passing it as MMSCode.
| Error | Meaning |
|---|---|
ERR:301: Failed authentication | Authentication failed. |
ERR:302: Invalid vasid | The VASID is wrong. |
ERR:303: Invalid password | The password is wrong. |
ERR:304: Invalid logon | The login is not valid. |
ERR:305: Not enough credits | Top up your account. |
ERR:306:Message Receipient is missing | TO is missing. |
ERR:307: Invalid delivery date time. | DeliveryDateTime could not be read. |
ERR:312: Failed to download content object. | A file could not be fetched from BaseURL. |
ERR:313: Invalid MMS Code | The MMSCode is unknown. |
ERR:314: Invalid MMS Code or no files specified. | Neither a valid MMSCode nor any files. |
ERR:400: System error | Server-side error; contact support. |

