ANTS API SPECIFICATION
Thai v1.0.0
Thai v1.0.0
  • เริ่มต้นการใช้งาน
  • 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
  • E-coupon
    • Get Campaign
    • Get Coupon
    • Create Coupon
    • E-Coupon Callback
    • E-Coupon Status Code
  • การย้าย API ระบบเก่า มา ระบบใหม่
Powered by GitBook
On this page

Was this helpful?

  1. SMS

Callback Delivery Report

รายงานและสถานะการส่ง Delivery Report (DR) จะถูกส่งไปยัง server ของท่าน

PreviousSend MessageNextMessage Logs

Last updated 4 years ago

Was this helpful?

ใช้สำหรับผู้ใช้งานต้องการทราบข้อมูลสถานะการส่งผ่าน (Delivery Report) จาก Operator โดยผู้ใช้ทำการระบุ Parameter ( notifyUrl และ notifyContentType) ที่การ request API ระบบจะทำการส่งข้อมูล ดังนี้

Sequence Diagram

ผู้ใช้งานสามารถเริ่มสร้าง HTTP ตามรายละเอียดดังนี้

หัวข้อ

รายละเอียด

HTTP Request (URL)

HTTP Headers

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

Authorization: (Basic Auth) Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

HTTP Methods

POST

ผู้ใช้งานต้องระบุ Request body ด้วย Parameter ดังนี้

ตัวแปร Parameter

ประเภทข้อมูล

รายละเอียด

bulkId

String

รหัสการส่งในแต่ละครั้ง

details

Array

ชุดข้อมูลกการตอบกลับ

messageId

String

รหัสอ้างอิงของแต่ละหมายเลข ในการส่งแต่ละครั้ง

to

String

หมายเลขที่ได้รับข้อความ

from

String

Sender Name ที่ส่ง

text

String

ข้อความที่ส่งหาหมายเลขผู้รับ

credit

Decimal

จำนวน credit ที่ใช้

sendDate

String

วันที่ระบบส่ง SMS

doneDate

String

วันที่ข้อความส่งถึงหมายเลขปลายทาง

status

Array

ชุดข้อมูลสถานะ

code

String

รหัสสถานะการตอบกลับ

name

String

ชื่อสถานะการตอบกลับ

description

String

รายละเอียดสถานะการตอบกลับ

callbackData

String

ค่าที่ต้องการให้ส่งกลับ

ตัวอย่าง Request JSON

 {
        "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": "25501288135972440650",
                    "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"
                }
        ]
} 

ตัวอย่าง Request XML

<?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

200 OK

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