Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Get Employee OT Settings

ดึงข้อมูลสิทธิ์ OT ของพนักงาน — แสดงว่าพนักงานสามารถทำ OT ประเภทใดได้บ้าง

Endpoint

GET /api/v1/open-apis/employee/get-employee-data-filter?path_action=get-ot

Query Parameters

ParameterTypeRequiredDescription
path_actionstringYesต้องเป็น get-ot
employee_codestringYesรหัสพนักงาน

ใช้ employee_code (รหัสพนักงาน เช่น EMP001) เพื่อระบุพนักงาน ถ้าพนักงานยังไม่มี record OT ค่าเริ่มต้นทุกประเภทจะเป็น true


Response Format

Success Response — มี record OT

{ "code": 200, "message": "สำเร็จ", "payload": { "employee_ot_id": "20260213ABC12345", "ot_1_0_able": true, "ot_1_5_able": true, "ot_2_0_able": true, "ot_3_0_able": false, "ot_4_0_able": false, "ot_5_0_able": false, "ot_6_0_able": false, "ot_7_0_able": false } }

Success Response — ยังไม่เคยตั้งค่า (ค่าเริ่มต้น = เปิดทั้งหมด)

{ "code": 200, "message": "สำเร็จ", "payload": { "employee_ot_id": null, "ot_1_0_able": true, "ot_1_5_able": true, "ot_2_0_able": true, "ot_3_0_able": true, "ot_4_0_able": true, "ot_5_0_able": true, "ot_6_0_able": true, "ot_7_0_able": true } }

Response Fields

FieldTypeDescription
employee_ot_idstring/nullID record OT (null = ยังไม่เคยตั้งค่า)
ot_1_0_ablebooleanอนุญาต OT 1.0 เท่า
ot_1_5_ablebooleanอนุญาต OT 1.5 เท่า
ot_2_0_ablebooleanอนุญาต OT 2.0 เท่า
ot_3_0_ablebooleanอนุญาต OT 3.0 เท่า
ot_4_0_ablebooleanอนุญาต OT 4.0 เท่า
ot_5_0_ablebooleanอนุญาต OT 5.0 เท่า
ot_6_0_ablebooleanอนุญาต OT 6.0 เท่า
ot_7_0_ablebooleanอนุญาต OT 7.0 เท่า

ค่าที่ return เป็น boolean (true/false) ไม่ใช่ string

Error Response

{ "code": 400, "message": "ไม่สำเร็จ", "error": "Employee not found with code: EMP999" }
เงื่อนไขError Message
ไม่ส่ง employee_code หรือว่างMissing required parameter: employee_code
หา employee ไม่เจอEmployee not found with code: xxx

Code Examples

curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/employee/get-employee-data-filter?path_action=get-ot&employee_code=EMP001" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -H "Content-Type: application/json"

  • Update OT - บันทึกสิทธิ์ OT ของพนักงาน (คนเดียว)
  • Update Multiple OT - บันทึกสิทธิ์ OT หลายคนพร้อมกัน
Last updated on