เริ่มต้นการใช้งาน

แนะนำข้อมูลเบื้องต้นเกี่ยวกับหลักการทำงานของ API ของ ANTS ในการส่งข้อความ จัดการบัญชีต่างๆ

ANTS API Platform Connectivity

ANTS HTTP Application Programing Interface (HTTP API)

ANTS API ถูกพัฒนาบนพื้นฐานของ Rest standards ทำให้ระบบของ ANTS สามารถให้บริการได้หลากหลาย ในรูปแบบ methods และ functions ต่าง ๆ เช่น การส่งข้อความ ดึงรายงานผล และ Message Logs ด้วยรูปแบบ JSON

Base URL

เราแนะนำให้เรียกใช้งานทุก Request มาที่ Base URL ผ่าน HTTP POST, GET method

Base URL: https://api-service.ants.co.th

Content-Type & Accept header

ANTS SMS API รองรับ JSON ดังนั้นควรจะระบุ Content-Types และเงื่อนไข Accept ไว้ใน Header ทั้งนี้ถ้าไม่ได้ระบุ Content-Type คุณจะได้รับ Error code ซึ่งขึ้นอยู่กับรูปแบบ Accept ที่ถูกเลือกใน header สำหรับการ Request

Content-Type: application/json

Accept header: application/json

Authorization

ระบบรองรับ Basic Authorization ด้วย username และ password กับ Base64 encoding RFC2045-MIME. ตัวอย่าง Authorization header สร้างได้ดังนี้ Username: Aladdin Password: opensesame

Guides

1. Username และ password ต้องถูกรวมกันในรูปแบบ string username:password 2. เข้ารหัส string โดยการใช้มาตรฐาน Base64 encoder

Base64 encoded string: QWxhZGRpbjpvcGVuc2VzYW1|

Authorization header: Basic QWxhZGRpbjpvcGVuc2VzYW1|

Last updated

Was this helpful?