# 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)](https://1969967505-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Zi-GfP5csjMyyZS2D%2F-M1yIhsflTgm2ZSSzXX-%2F-M1yxNNTqTaxUqBVuoNs%2Flog.png?alt=media\&token=03f83824-24d1-451c-9677-23759a5960c3)

{% 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 %}
