Skip to Content
🚀 Welcome to Humansoft Open API Documentation

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

FieldTypeDescription
master_salary_ot_report_template_idstringรหัส Template (ต้องแปลงเป็น Base64 ก่อนส่งกลับเข้า request)
master_salary_ot_template_codestringรหัสอ้างอิงที่ระบบสร้างให้
master_salary_ot_template_namestringชื่อ Template
ot_template_start_dtstringวันที่ของเดือนที่เริ่มรอบ เช่น 21
ot_template_end_dtstringวันที่ของเดือนที่จบรอบ เช่น 20 หรือ EOM = สิ้นเดือน
ot_template_start_monthintจำนวนเดือนที่เลื่อนจากงวดเงินเดือน เช่น -1 = เริ่มเดือนก่อนหน้า
employee_countintจำนวนพนักงานที่บันทึกไว้ใน Template นี้

Code Examples

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 ว่าง
Last updated on