---
title: Query SMS-MT Details
slug: query-sms-mt-details
createdAt: 2026-02-05T09:33:58.280Z
---

## Purpose

Returns details and current delivery status of Mobile Terminated (MT) SMS messages sent to the SIM specified in the \<iccid> element.

This includes messages sent:

- From the SIM Insight Portal&#x20;
- Via the SIM Insight API

:::hint{type="info"}
This function is not available for Open-User-Group SIM types (e.g. MultiNET KPN-O).
:::

### Endpoint

```xml
POST https://api.m2miportal.com
Content-Type: application/xml
Accept: application/xml
```



### Request (XML)

```xml
<query-sms-mt-details version="1" api-id="123456">
  <authentication>
    <username>username</username>
    <password>password</password>
  </authentication>
  <iccid>1234567890123456789</iccid>
  <lastx>3</lastx>
</query-sms-mt-details>
```

### Response (Success)

```xml
<query-sms-mt-details-response api-id="123456">
  <api-outcome>Success</api-outcome>
  <sms>
    <sent-timestamp>09/10/2014 20:08:04</sent-timestamp>
    <sms-uid>84ry3h2160</sms-uid>
    <status>Delivered</status>
    <delivered-timestamp>09/10/2014 20:08:14</delivered-timestamp>
    <origin>API</origin>
    <message-text>Reset Modem</message-text>
  </sms>
  <sms>
    <sent-timestamp>09/10/2014 16:28:15</sent-timestamp>
    <sms-uid>84ry3h2189</sms-uid>
    <status>Pending</status>
    <delivered-timestamp></delivered-timestamp>
    <origin>Portal</origin>
    <message-text>Update APN Setting</message-text>
  </sms>
</query-sms-mt-details-response>

```

### Request Parameters

| Element  | Required | Description                                                            |
| -------- | -------- | ---------------------------------------------------------------------- |
| \<iccid> | Yes      | Target SIM ICCID.                                                      |
| \<lastx> | No       | Integer between 1 and 20. Number of most recent MT messages to return. |

### Behaviour

- If \<lastx> is omitted → Only the most recent message is returned.&#x20;
- Results are returned with the **most recently sent message first**.&#x20;
- If no messages are available → A single empty \<sms> element is returned.&#x20;

## Response Elements

Each message is enclosed within an \<sms> element.

| Element                | Description                                                   |
| ---------------------- | ------------------------------------------------------------- |
| \<sent-timestamp>      | UTC date/time message was sent. Format: DD/MM/YYYY HH\:MM\:SS |
| \<sms-uid>             | Included only if specified when the SMS was sent.             |
| \<status>              | Current delivery status: Pending, Delivered or Failed         |
| \<delivered-timestamp> | UTC delivery time. Empty if not delivered.                    |
| \<origin>              | Indicates message source: Portal or API                       |
| \<message-text>        | SMS content in plain text (XML substitutions applied).        |

## Status Values

| Status    | Meaning                             |
| --------- | ----------------------------------- |
| Pending   | Message queued or awaiting delivery |
| Delivered | Successfully delivered to device    |
| Failed    | Delivery failed                     |

## Encoding Notes

- Message text is returned in plain text (with standard XML reserved character substitutions).&#x20;
- Character set is restricted to GSM 7-bit default alphabet (3GPP TS 23.038).&#x20;
- Other character sets may result in unpredictable outcomes.&#x20;
- If the SMS was sent using \<data-coding>binary\</data-coding> (MultiNET KPN-C only), the \<message-text> element will be returned encoded as Base64.&#x20;

## Additional Notes

- Historical SMS records sent prior to March 2016 may have an empty \<origin> element.&#x20;
- Delivery status may change over time as operator delivery receipts are received.&#x20;
- This endpoint returns only Mobile Terminated (MT) messages.

:::hint{type="info"}
### Operational Notes

- SMS can only be delivered to Active SIMs.
- SMS availability depends on SIM type and operator support.
- Delivery is not guaranteed and may be asynchronous.
- Operator limits may result in message rejection.
:::

:::hint{type="info"}
## Response (Failure)

If a request cannot be processed, the response will include:

- api-outcome indicating failure&#x20;
- An error description explaining the reason&#x20;

Failure responses may occur due to:

- Invalid authentication credentials&#x20;
- Invalid or unknown identifiers (for example ICCID or MSISDN)&#x20;
- Invalid or missing parameters&#x20;
- Values not permitted for the specified SIM type or account configuration&#x20;
- Insufficient permissions&#x20;

Integrating systems should validate input data before submission and implement appropriate error handling and logging.
:::

