# Callback Delivery Report

&#x20;       To ge the delivery report from Operator; you can define Parameter (notifyUrl and notifyContentType) in requesting API [**Send**](/api-sms-1/api-sms.md)**.** Our platform will push following information

### Sequence Diagram

![](/files/-M2D9DFjJILpdb1Yj-Rd)

{% tabs %}
{% tab title="Request" %}
**You can start creating HTTP request as this following:**

| Header             | Description                                                                                                                     |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| HTTP Request (URL) | <https://api-service.ants.co.th/sms/callback>                                                                                   |
| HTTP Headers       | <p>Content-Type: application/json หรือ application/xml</p><p>Authorization: (Basic Auth) Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</p> |
| HTTP Methods       | POST                                                                                                                            |

**Request body should contain Parameter**

| **Parameter** | type    | description                                                                                                                                |
| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| bulkId        | String  | The ID which uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.  |
| details       | Array   | Set of information from the response                                                                                                       |
| messageId     | String  | The ID that uniquely identifies the sent message                                                                                           |
| to            | String  | The destination mobile number for your message                                                                                             |
| from          | String  | Represents a sender ID which can be alphanumeric or numeric (maximum 11 characters, space is not allowed. `Example: from = ANTS`           |
| text          | String  | Text of the message that will be sent.                                                                                                     |
| credit        | Decimal | SMS credit usage.                                                                                                                          |
| sendDate      | String  | Date and time when the message is to be sent. Used for scheduled SMS (not sent immediately, but at scheduled time).                        |
| doneDate      | String  | Tells when the SMS was finished processing by our system/network operator system (ie. delivered to destination network, delivered, etc.)   |
| status        | Array   | Indicates whether the message is successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status. |
| code          | String  | Code ID of return status.                                                                                                                  |
| name          | String  | Name of return status.                                                                                                                     |
| description   | String  | Description of return status.                                                                                                              |
| callbackData  | String  | The metadata value will be returned.                                                                                                       |

**Sample JSON Response**&#x20;

```
 {
        "bulkId": "898319fa-34f0-49b7-a3b0-4235cc716a1f",
        "details": [
                {
                    "messageId": "25501288135972440649",
                    "to": "66123456789",
                    "from": "ANTS",
                    "text": "เชิญชวนร่วมกิจกรรม วิ่งการกุศล ANTS มาราธอน",
                    "credit": 1.00,
                    "sendDate": "2019-05-27T14:39:40.273",
                    "doneDate": "2019-05-27T14:40:09.44",
                    "status": {
                        "code": "000",
                        "name": "DELIVERED",
                        "description": "Successfully sent to phone"
                    },
                    "callbackData": "ANTS Data"
                },
                {
                    "messageId": "25501288135972440649",
                    "to": "66112233445",
                    "from": "Verify",
                    "text": "เชิญชวนร่วมกิจกรรม วิ่งการกุศล ANTS มาราธอน",
                    "credit": 1.00,
                    "sendDate": "2019-05-27T14:39:49.383",
                    "doneDate": "2019-05-27T14:40:09.66",
                    "status": {
                        "code": "000",
                        "name": "DELIVERED",
                        "description": "Successfully sent to phone"
                    },
                    "callbackData": "ANTS Data"
                }
        ]
} 

```

**Sample XML response**

```
<?xml version="1.0" encoding="utf-16"?>
<CALLBACK xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <bulkId>9f4b72ca-0e28-4a7f-a6ff-d6483a17f3fa</bulkId>
    <details>
        <detail>
            <messageId>25501288135972440649</messageId>
            <to>66123456789</to>
            <from>Verify</from>
            <text>เชิญชวนร่วมกิจกรรม วิ่งการกุศล ANTS มาราธอน</text>
            <credit>1.00</credit>
            <sendDate>2019-05-27T14:39:40.273</sendDate>
            <doneDate>2019-05-27T14:40:09.44</doneDate>
            <status>
                <code>000</code>
                <name>DELIVERED</name>
                <description>Successfully sent to phone</description>
            </status>
            <callbackData>ANTS Data</callbackData>
        </detail>
        <detail>
            <messageId>25501288135972440650</messageId>
            <to>66112233445</to>
            <from>Verify</from>
            <text>เชิญชวนร่วมกิจกรรม วิ่งการกุศล ANTS มาราธอน</text>
            <credit>1.00</credit>
            <sendDate>2019-05-27T14:39:49.383</sendDate>
            <doneDate>2019-05-27T14:40:09.66</doneDate>
            <status>
                <code>000</code>
                <name>DELIVERED</name>
                <description>Successfully sent to phone</description>
            </status>
            <callbackData>ANTS Data</callbackData>
        </detail>
    </details>
</CALLBACK>

```

{% endtab %}

{% tab title="Response" %}
Response ตอบกลับผู้ใช้งาน เป็น HTTP Status Code ซึ่งส่วนใหญ่สถานะ จะแสดงเป็น 200 OK และ 404 Not Found ถ้าค่าเป็น 200 OK แสดงว่าข้อมูลส่งถูกต้อง

**Response JSON Sample**

{% hint style="success" %}
200 OK
{% endhint %}

{% hint style="danger" %}
404 Not Found
{% endhint %}
{% endtab %}
{% endtabs %}


---

# 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://apidoc.ants.co.th/api-sms-1/callback.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.
