List received messages
GET /messages/inbox lists the SMS and MMS messages your texting numbers received, by date range, a page at a time.
https://msgapi.wire2air.com/rest/v1/messages/inboxParameters
Send the parameters in the query string. All are optional.
| Parameter | In | Description |
|---|---|---|
| datefrom stringoptional in query | query | Start of the date range. The range from datefrom to dateto cannot be longer than 31 days. |
| dateto stringoptional in query | query | End of the date range. |
| TextNumber stringoptional in query | query | Only messages sent to this one of your short codes or texting numbers. |
| PageNo integeroptional in query | query | The results page to return. |
| PageSize integeroptional in query | query | Results per page. |
Examples
curl -G "https://msgapi.wire2air.com/rest/v1/messages/inbox" \
-H "apikey: YOUR_API_KEY" \
--data-urlencode "datefrom=10/1/2026" \
--data-urlencode "dateto=10/6/2026" \
--data-urlencode "TextNumber=27126" \
--data-urlencode "PageNo=1" \
--data-urlencode "PageSize=100"
import urllib.error
import urllib.parse
import urllib.request
params = urllib.parse.urlencode({
"datefrom": "10/1/2026",
"dateto": "10/6/2026",
"TextNumber": "27126",
"PageNo": "1",
"PageSize": "100",
})
request = urllib.request.Request(
"https://msgapi.wire2air.com/rest/v1/messages/inbox?" + params,
headers={"apikey": "YOUR_API_KEY"},
method="GET",
)
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({
datefrom: "10/1/2026",
dateto: "10/6/2026",
TextNumber: "27126",
PageNo: "1",
PageSize: "100",
});
const response = await fetch(`https://msgapi.wire2air.com/rest/v1/messages/inbox?${params}`, {
method: "GET",
headers: { apikey: "YOUR_API_KEY" },
});
console.log(response.status, await response.text());
<?php
$params = http_build_query([
'datefrom' => '10/1/2026',
'dateto' => '10/6/2026',
'TextNumber' => '27126',
'PageNo' => '1',
'PageSize' => '100',
]);
$ch = curl_init('https://msgapi.wire2air.com/rest/v1/messages/inbox?' . $params);
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['apikey: YOUR_API_KEY'],
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>
{
["datefrom"] = "10/1/2026",
["dateto"] = "10/6/2026",
["TextNumber"] = "27126",
["PageNo"] = "1",
["PageSize"] = "100",
};
using var client = new HttpClient();
var query = await new FormUrlEncodedContent(parameters).ReadAsStringAsync();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://msgapi.wire2air.com/rest/v1/messages/inbox?" + query);
request.Headers.Add("apikey", "YOUR_API_KEY");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
Response
The results come in the page envelope. Each item in ListItems is one received message:
{
"PageNo": 1,
"PageSize": 10,
"TotalPages": 1.0,
"TotalRecords": 1,
"RowStart": 1,
"RowEnd": 1,
"ListItems": [
{
"to": "27126",
"from": "12129201000",
"deliverydatetime": "",
"text": "",
"batchname": "",
"replypath": "",
"campaignid": "16654",
"concatenate": "",
"subscribername": "Sam",
"username": "demo5",
"submitteddatetime": "",
"status": "",
"receiveddatetime": "2017-12-22T18:42:09Z",
"MessageType": "MMS",
"Direction": "In",
"URI": "v1/message/inbox/4986616",
"ID": "4986616",
"MMSURL": "v1/message/inbox/mms/4986616",
"baseurl": "",
"attachments": "",
"subject": "",
"bulkmode": "",
"Media": null
}
]
}
{
"StatusCode": 708,
"StatusMessage": "Please select 31 or less days range."
}
The fields the documentation describes:
| Field | Example | Meaning |
|---|---|---|
ID | 4986616 | The message's ID. |
to | 27126 | Your number that received the message: a short code, local, landline or toll-free number. |
from | 12129201000 | The sender's mobile number. |
receiveddatetime | 2017-12-22T18:42:09Z | When the message arrived, in UTC. |
subscribername | Sam | The sender's name from your subscriber data, if you have it. |
MessageType | MMS | SMS or MMS. |
MMSURL | v1/message/inbox/mms/4986616 | For MMS, a link to the message's media (see below). |
The other fields in the sample are not described.
MMS media
For an MMS, MMSURL points to its content. The previous docs showed this response for it, without documenting the request:
{
"subject": "",
"textcontent": "",
"files": [
{
"name": "http://mms.wire2air.com/mmsdata/mmsinbox/29a8d4e9-0be9-4c10-9ac6-3388f0b4a15d/0.jpg",
"type": "Image"
}
]
}

