Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Calculate Year

ปรับปีที่นับโควตาของบันทึกการลาให้ถูกต้องตามกฎของระบบ ใช้เมื่อต้องการคำนวณว่าการลาควรนับเป็นโควตาของปีใด

Endpoint

POST /api/v1/open-apis/salary/update-data-filter

Request Body

ParameterTypeRequiredDescriptionExample
path_actionstringYesต้องเป็น calculate_year"calculate_year"
quota_yearstringYesปีโควตา (YYYY)"2026"
company_idstringNoกรองตามบริษัท (Base64)-
branch_idstringNoกรองตามสาขา (Base64)-
department_idstringNoกรองตามแผนก (Base64)-
position_idstringNoกรองตามตำแหน่ง (Base64)-
employee_idstringNoเฉพาะพนักงานคนเดียว (Base64)-
keywordstringNoค้นหาพนักงาน-

Response Format

Success Response

{ "code": 200, "message": "สำเร็จ", "payload": [ { "employee_id": "202503219741427917A0", "employee_code": "EMP001", "updated_records": 3 }, { "employee_id": "20250321A8B9C0D1E2F3", "employee_code": "EMP002", "updated_records": 1 } ] }

Error Response

{ "code": 400, "message": "ไม่สำเร็จ", "errors": ["Missing required parameter: 'quota_year'"] }

Code Examples

curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/salary/update-data-filter" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "path_action": "calculate_year", "quota_year": "2026" }'

Notes

  • API นี้ตรวจสอบว่าการลาแต่ละรายการควรนับเป็นโควตาของปีใด แล้วปรับ in_year ให้ถูกต้อง
  • ใช้เมื่อมีการเปลี่ยนกฎเกณฑ์การนับปีโควตา หรือข้อมูลการลาข้ามปี

  • Calculate Quota - คำนวณยอดโควตาจากข้อมูลการลา
  • Reset Quota - รีเซ็ตโควตาทั้งหมด
Last updated on