Appearance
03.02 Base URL & API Versioning
📌 At a Glance
| รายการ | รายละเอียด |
|---|---|
| Topic | Base URL & Versioning |
| Difficulty | ⭐ Beginner |
| Reading Time | 5 นาที |
| Target | Developer |
| API Version | V1.1 |
🎯 Learning Objectives
หลังจากศึกษาหัวข้อนี้แล้ว ผู้อ่านจะสามารถ
- เข้าใจ Base URL ของ SISAHYGO API
- เข้าใจรูปแบบการกำหนด Version
- เข้าใจแนวทางรองรับ API Version ในอนาคต
Overview
SISAHYGO Integration Platform ใช้ URL แบบ Versioned API เพื่อรองรับการพัฒนาในอนาคตโดยไม่กระทบ Client System ที่ใช้งานอยู่
Version จะกำหนดไว้ใน URL Path ทำให้สามารถเปิดให้บริการหลายเวอร์ชันพร้อมกันได้
Figure 3-2 Base URL & Versioning
(แทรกรูป Figure 3-2 : Base URL & Versioning)

Figure 3-2 แสดงโครงสร้าง URL ของ SISAHYGO API โดยประกอบด้วย Protocol, Host, API Path, Version และ Resource Endpoint
Production Environment
| Environment | Base URL |
|---|---|
| Production | https://app.sisahygo.online/api/v1 |
URL Structure
https://app.sisahygo.online/api/v1/{resource}ตัวอย่าง
GET https://app.sisahygo.online/api/v1/products
GET https://app.sisahygo.online/api/v1/receivers
POST https://app.sisahygo.online/api/v1/order-checkings
GET https://app.sisahygo.online/api/v1/shipments
GET https://app.sisahygo.online/api/v1/order-rejectionsAPI Versioning Policy
ปัจจุบัน
V1.1ในอนาคต
/api/v2
/api/v3Client ที่ยังใช้ V1 จะไม่ได้รับผลกระทบจากการเปิดใช้งาน Version ใหม่
Key Points
| Item | Description |
|---|---|
| Protocol | HTTPS |
| API Format | REST API |
| Data Format | JSON |
| Current Version | V1.1 |
| Version Strategy | URL Path Versioning |
Best Practices
- ใช้ Base URL จาก Configuration
- ไม่ Hardcode Version ในหลายตำแหน่ง
- รองรับการเปลี่ยน Version ในอนาคต
- ใช้ HTTPS ทุกครั้ง
Summary
SISAHYGO API ใช้ URL Path Versioning เพื่อให้สามารถพัฒนา API รุ่นใหม่ได้โดยไม่กระทบ Client System เดิม และใช้ Base URL เดียวกันสำหรับทุก Endpoint ภายใต้ Version เดียวกัน
Next Step
➡️ 03.03 Authentication Standard
