# Message Logs

&#x20;       This Logs API will show the details of destination, messages sent, status, and reason. Records can be shown up to 30,000 latest transactions within 48 hours.&#x20;

### Sequence Diagram

![Sequence Diagram (API Loginfo)](/files/-M1yxNNTqTaxUqBVuoNs)

{% 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/loginfo>                                                               |
| HTTP Headers       | <p>Content-Type: application/json</p><p>Authorization: (Basic Auth) Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</p> |
| HTTP Methods       | GET                                                                                                        |

#### :exclamation: You must input at least 1 parameter. If it is a date; start and end date is required&#x20;

| **Parameters** | 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. |
| messageId      | String | The ID that uniquely identifies the message sent.                                                                                         |
| mobile         | String | The destination mobile number for your message                                                                                            |
| sendDateStart  | String | Lower limit on date and time of sending SMS.                                                                                              |
| sendDateEnd    | String | Upper limit on date and time of sending SMS.                                                                                              |

**Sample Request (method : Get)**

```
HTTP Request (URL): https://api-service.ants.co.th/sms/loginfo?
senddate_start=2019-05-27T14:39:00.00&senddate_end=2019-05-27T15:04:39.64
```

{% endtab %}

{% tab title="Response" %}
**Message Logs Response**

| Parameters  | Type    | Description                                                                                                                                   |
| ----------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| bulkId      | String  | The ID that 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 logs information                                                                                                                       |
| messageId   | String  | The ID that uniquely identifies the message sent.                                                                                             |
| 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.)etc.) |
| status      | String  | 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        | StringN | Name of return status.                                                                                                                        |
| description | String  | Description of return status.                                                                                                                 |

**The response will look like:**

```
[
    {
      "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"
                    }
                },
                {
	              "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"
                    }
                }
        ]
    }
]

```

{% 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/loginfo.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.
