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

Preview Message

PreviousMessage LogsNextSender List

Last updated 4 years ago

Was this helpful?

ใช้สำหรับนับจำนวนข้อความก่อนส่ง SMS จริงได้ เพื่อตรวจสอบจำนวนข้อความและเครดิตทั้งหมด รวมทั้งจำนวนตัวอักษรที่ส่งโดยไม่มีค่าใช้จ่าย ซึ่งช่วยให้ผู้ใช้สามารถปรับ แก้ไข และประมาณการค่าใช้จ่ายก่อนส่งจริงได้อย่างแม่นยำมากยิ่งขึ้น

Sequence Diagram

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

หัวข้อ

รายละเอียด

HTTP Request (URL)

HTTP Headers

Content-Type: application/json

Authorization: (Basic Auth) Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

HTTP Methods

POST

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

Parameter

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

รายละเอียด

message

String

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

ตัวอย่าง Request JSON

{
"message": "Let's see how many characters will remain unused in this message."
}

Response ตอบกลับผู้ใช้งาน ดังนี้

ชุดข้อมูลผลลัพธ์

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

รายละเอียด

originalMessage

String

ข้อความดั้งเดิมที่ผู้ใช้ส่งเข้ามาเพื่อดูผล preview

credit

Number

จำนวนข้อความที่จะถูกใช้ในการส่ง

character

String

จำนวนตัวอักษรที่จะถูกส่ง

ตัวอย่าง Response JSON

{
"originalMessage": "Let's see how many characters will remain unused in this message.",
"credit":  "1.00",
"character": 65
}

https://api-service.ants.co.th/sms/preview
รูปภาพ Sequence Diagram (API Preview)