List OT Templates
ดูรายการ OT Template ทั้งหมดที่บันทึกไว้
Template คือรูปแบบงวดโอทีที่บันทึกไว้ใช้ซ้ำทุกเดือน — เก็บ master_salary_ot_report_template_id ที่ได้ไว้ส่งให้ Create Round from Template
Endpoint
POST /api/v1/open-apis/calculation-ot/get-list-ot-round-templateสิทธิ์ที่ต้องการ: API Key ต้องมีสิทธิ์ ข้อมูลเงินเดือนทั้งองค์กร (payroll:read:all)
Request Parameters
ไม่มี parameters
Response Format
Success Response (HTTP 200)
{
"code": 200,
"message": "Get OT templates Accept",
"payload": [
{
"master_salary_ot_report_template_id": "20251127T8891F6A3D024",
"master_salary_ot_template_code": "OT-T001",
"master_salary_ot_template_name": "งวดโอที 21-20",
"ot_template_start_dt": "21",
"ot_template_end_dt": "20",
"ot_template_start_month": -1,
"employee_count": 25
}
]
}Error Response - Unauthorized (HTTP 401)
{
"code": 401,
"message": "Unauthorized",
"payload": []
}วิธีแก้: ตรวจสอบว่า API Key ถูกต้องและมีสิทธิ์ตามที่ระบุไว้ด้านบน — ดูวิธีตั้งค่าได้ที่ Get Started
Response Fields
| Field | Type | Description |
|---|---|---|
master_salary_ot_report_template_id | string | รหัส Template (ต้องแปลงเป็น Base64 ก่อนส่งกลับเข้า request) |
master_salary_ot_template_code | string | รหัสอ้างอิงที่ระบบสร้างให้ |
master_salary_ot_template_name | string | ชื่อ Template |
ot_template_start_dt | string | วันที่ของเดือนที่เริ่มรอบ เช่น 21 |
ot_template_end_dt | string | วันที่ของเดือนที่จบรอบ เช่น 20 หรือ EOM = สิ้นเดือน |
ot_template_start_month | int | จำนวนเดือนที่เลื่อนจากงวดเงินเดือน เช่น -1 = เริ่มเดือนก่อนหน้า |
employee_count | int | จำนวนพนักงานที่บันทึกไว้ใน Template นี้ |
Code Examples
cURL
curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/calculation-ot/get-list-ot-round-template" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Notes
- ถ้ายังไม่เคยสร้าง Template จะได้
payloadเป็น array ว่าง
Related APIs
- Create Round from Template - ใช้ Template นี้สร้างงวดจริง
- Get OT Template - ดูรายละเอียดของ Template ตัวใดตัวหนึ่ง
- Create OT Template - สร้าง Template ใหม่
Last updated on