ANTS API SPECIFICATION
English v1.0.0
English v1.0.0
  • INTRODUCTION
  • ACCOUNT
  • SMS
    • Send Message
    • Callback Delivery Report
    • Message Logs
    • Preview Message
    • Sender List
    • Status and Error codes
  • OTP (One Time Password)
  • SMS 2 WAY Interactive
Powered by GitBook
On this page

Was this helpful?

  1. SMS

Callback Delivery Report

PreviousSend MessageNextMessage Logs

Last updated 4 years ago

Was this helpful?

To ge the delivery report from Operator; you can define Parameter (notifyUrl and notifyContentType) in requesting API . Our platform will push following information

Sequence Diagram

You can start creating HTTP request as this following:

Header

Description

HTTP Request (URL)

HTTP Headers

Content-Type: application/json หรือ application/xml

Authorization: (Basic Auth) Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

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

 {
        "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>

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

Response JSON Sample

200 OK

404 Not Found

https://api-service.ants.co.th/sms/callback
Send