Get Employee OT Settings
ดึงข้อมูลสิทธิ์ OT ของพนักงาน — แสดงว่าพนักงานสามารถทำ OT ประเภทใดได้บ้าง
Endpoint
GET /api/v1/open-apis/employee/get-employee-data-filter?path_action=get-otQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path_action | string | Yes | ต้องเป็น get-ot |
employee_code | string | Yes | รหัสพนักงาน |
ใช้ 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
| Field | Type | Description |
|---|---|---|
employee_ot_id | string/null | ID record OT (null = ยังไม่เคยตั้งค่า) |
ot_1_0_able | boolean | อนุญาต OT 1.0 เท่า |
ot_1_5_able | boolean | อนุญาต OT 1.5 เท่า |
ot_2_0_able | boolean | อนุญาต OT 2.0 เท่า |
ot_3_0_able | boolean | อนุญาต OT 3.0 เท่า |
ot_4_0_able | boolean | อนุญาต OT 4.0 เท่า |
ot_5_0_able | boolean | อนุญาต OT 5.0 เท่า |
ot_6_0_able | boolean | อนุญาต OT 6.0 เท่า |
ot_7_0_able | boolean | อนุญาต 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
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"Related APIs
- Update OT - บันทึกสิทธิ์ OT ของพนักงาน (คนเดียว)
- Update Multiple OT - บันทึกสิทธิ์ OT หลายคนพร้อมกัน
Last updated on