Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Update Multiple Employee OT

บันทึกการตั้งค่าสิทธิ์ OT ให้พนักงานหลายคนพร้อมกัน

Endpoint

POST /api/v1/open-apis/employee/update-employee-setting?path_action=save-ot-multiple

Query Parameters

ParameterTypeRequiredDescription
path_actionstringYesต้องเป็น save-ot-multiple หรือ ot-multiple

Request Body

ParameterTypeRequiredDescription
employee_listsarrayYesรายการพนักงานและ flag OT

employee_lists — แต่ละ item

FieldTypeRequiredDescription
employee_codestringRecommendedรหัสพนักงาน
employee_idstringOptionalID พนักงาน (Base64-encoded) — ใช้ได้ถ้าไม่ส่ง employee_code
employee_ot_idstring/nullNoID record OT (null = สร้างใหม่)
ot_1_0_ablestringNoOT 1.0 เท่า ("Y"/"N")
ot_1_5_ablestringNoOT 1.5 เท่า
ot_2_0_ablestringNoOT 2.0 เท่า
ot_3_0_ablestringNoOT 3.0 เท่า
ot_4_0_ablestringNoOT 4.0 เท่า
ot_5_0_ablestringNoOT 5.0 เท่า
ot_6_0_ablestringNoOT 6.0 เท่า
ot_7_0_ablestringNoOT 7.0 เท่า

แนะนำให้ใช้ employee_code แทน employee_id ถ้าพนักงานคนไหนไม่พบ ระบบจะ skip คนนั้นและดำเนินการต่อ


Response Format

Success Response

{ "code": 200, "message": "Save OT Multiple Success", "payload": { "total_processed": 2, "employees": [ { "employee_id": "20260121FC89F3BB9120", "employee_ot_id": "20260213OT01A2B3C4D5", "ot_1_0_able": "Y", "ot_1_5_able": "Y", "ot_2_0_able": "Y", "ot_3_0_able": "N", "ot_4_0_able": "N", "ot_5_0_able": "N", "ot_6_0_able": "N", "ot_7_0_able": "N" }, { "employee_id": "20260121AB12CD34EF56", "employee_ot_id": "20260213ABC456", "ot_1_0_able": "N", "ot_1_5_able": "Y", "ot_2_0_able": "N", "ot_3_0_able": "N", "ot_4_0_able": "N", "ot_5_0_able": "N", "ot_6_0_able": "N", "ot_7_0_able": "N" } ] } }

Response Fields

FieldTypeDescription
total_processednumberจำนวนพนักงานที่ประมวลผลสำเร็จ
employeesarrayรายการผลลัพธ์แต่ละคน
employees[].employee_idstringemployee_id ของพนักงาน
employees[].employee_ot_idstringรหัส OT record
employees[].ot_x_ablestringสถานะ OT แต่ละประเภท ("Y" หรือ "N")

Error Response

{ "code": 400, "message": "ข้อมูลไม่ถูกต้อง", "errors": ["กรุณาระบุ 'employee_lists'"] }
เงื่อนไขError Message
ไม่ส่ง employee_lists หรือว่างกรุณาระบุ 'employee_lists'
employee_lists ไม่เป็น array'employee_lists' ต้องเป็น array
หา employee ไม่เจอskip คนนั้น ทำต่อ

Code Examples

curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/update-employee-setting?path_action=save-ot-multiple" \ -H "Content-Type: application/json" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -d '{ "employee_lists": [ { "employee_code": "EMP001", "employee_ot_id": null, "ot_1_0_able": "Y", "ot_1_5_able": "Y", "ot_2_0_able": "Y", "ot_3_0_able": "N", "ot_4_0_able": "N", "ot_5_0_able": "N", "ot_6_0_able": "N", "ot_7_0_able": "N" }, { "employee_code": "2222", "employee_ot_id": "20260213ABC456", "ot_1_0_able": "N", "ot_1_5_able": "Y", "ot_2_0_able": "N", "ot_3_0_able": "N", "ot_4_0_able": "N", "ot_5_0_able": "N", "ot_6_0_able": "N", "ot_7_0_able": "N" } ] }'

  • Get OT - ดึงข้อมูลสิทธิ์ OT ของพนักงาน
  • Update OT - บันทึกสิทธิ์ OT ของพนักงานรายบุคคล
Last updated on