Skip to content

03.02 Base URL & API Versioning


📌 At a Glance

รายการรายละเอียด
TopicBase URL & Versioning
Difficulty⭐ Beginner
Reading Time5 นาที
TargetDeveloper
API VersionV1.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

Figure 3-2 แสดงโครงสร้าง URL ของ SISAHYGO API โดยประกอบด้วย Protocol, Host, API Path, Version และ Resource Endpoint


Production Environment

EnvironmentBase URL
Productionhttps://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-rejections

API Versioning Policy

ปัจจุบัน

V1.1

ในอนาคต

/api/v2
/api/v3

Client ที่ยังใช้ V1 จะไม่ได้รับผลกระทบจากการเปิดใช้งาน Version ใหม่


Key Points

ItemDescription
ProtocolHTTPS
API FormatREST API
Data FormatJSON
Current VersionV1.1
Version StrategyURL 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

SISAHYGO API Integration Guide