> For the complete documentation index, see [llms.txt](https://apidoc.ants.co.th/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidoc.ants.co.th/thai-v1.0.0/master.md).

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

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

<div align="center"><img src="https://980245403-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Zi-GfP5csjMyyZS2D%2F-M1ZiSbSYIhfTE5ffxyS%2F-M1Zklp4sNBBnnTVkPfI%2FPicture1.png?alt=media&amp;token=a1083800-dcb5-4e30-ac95-f292b9981ab7" alt="ANTS API Platform Connectivity"></div>

## ANTS HTTP Application Programing Interface (HTTP API)

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

### Base URL

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

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

### Content-Type & Accept header

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

&#x20;        Content-Type:  `application/json`

&#x20;        Accept header: `application/json`

#### Authorization

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

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

&#x20;        Base64 encoded string: `QWxhZGRpbjpvcGVuc2VzYW1|`

&#x20;        Authorization header: `Basic QWxhZGRpbjpvcGVuc2VzYW1|`
