# Receive SMS status

There are two ways to get SMS status:

## Refer to our link <a href="#refer-to-our-link" id="refer-to-our-link"></a>

It is required to refer to our link `https://sms-hub.miatel.com:8009/sms_status?id={{message_id}}` where `{{message_id}}` is the received message id when sending the request.

### **Response Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

### **Response body**

| Name     | Type   | Description                                                                     |
| -------- | ------ | ------------------------------------------------------------------------------- |
| currency | string | Currency of use                                                                 |
| rate     | string | Used rate plan if set                                                           |
| segments | number | Number of short messages delivered. The value may be padded with leading zeros. |
| status   | number | The final code status of the message                                            |

### **Possible code statuses of the message**

<table><thead><tr><th width="245">Status</th><th>Status name</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>ENROUTE</td><td>The message is in enroute state</td></tr><tr><td>2</td><td>DELIVERED</td><td>Message is delivered to destination</td></tr><tr><td>3</td><td>EXPIRED</td><td>Message validity period has expired</td></tr><tr><td>4</td><td>DELETED</td><td>Message has been deleted</td></tr><tr><td>5</td><td>UNDELIVERABLE</td><td>Message is undeliverable</td></tr><tr><td>6</td><td>ACCEPTED</td><td><p>Message is in accepted state (i.e. has been manually read on behalf of the subscriber by customer service)</p><p><br></p><p>This status is not considered as final on the Miatel platform.</p></td></tr><tr><td>7</td><td>UNKNOWN</td><td>Message is in invalid state</td></tr><tr><td>8</td><td>REJECTED</td><td>Message is in a rejected state</td></tr></tbody></table>

### **Response example**

```
200400{"currency": "EUR","rate": "0.1","segments": 1,"status": 2}
```

## Provide a link <a href="#provide-a-link" id="provide-a-link"></a>

You provide a link to which we will refer to inform the status of the subscriber.

### Link example&#x20;

`https://api.client.com/miatel/res.php?id={{id}}&dlvr={{dlvrd}}&status={{status}}&{{statusname}}`

### Supported parameters

The URI string can contain these keywords to be replaced by real values.&#x20;

| Field          | Type   | Description                                                                                |
| -------------- | ------ | ------------------------------------------------------------------------------------------ |
| {{id}}         | string | The message ID allocated to the message by the SMSC when originally submitted.             |
| {{from}}       | string | Source side                                                                                |
| {{to}}         | string | Destination side                                                                           |
| {{status}}     | number | The final code status of the message.                                                      |
| {{sub}}        | number | Number of short messages originally submitted. The value may be padded with leading zeros. |
| {{dlvrd}}      | number | Number of short messages delivered. The value may be padded with leading zeros.            |
| {{statusname}} | string | The final status of the message.                                                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.miatel.com/api/sms-api/receive-sms-status.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
