Get Calendar Month Filter
ดึงปฏิทินการทำงานตามช่วงวันที่ที่ระบุ ไม่จำกัดตามรอบเงินเดือน แสดงรายการพนักงานที่ทำงาน/ลา/หยุดในแต่ละวัน
Endpoint
GET /api/v1/open-apis/salary/get-data-filter?path_action=get_calendar_month_filterRequest Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
start_date | string | Yes | วันที่เริ่มต้น (YYYY-MM-DD) | "2026-02-01" |
end_date | string | Yes | วันที่สิ้นสุด (YYYY-MM-DD) | "2026-02-28" |
type | string | Yes | ประเภทการกรอง: "leave", "work_cycle", "holiday" | "leave" |
time_leave_flag | string | No | รหัสประเภทการลา (ใช้เมื่อ type=leave) | "01" |
work_cycle_id | string | No | รหัสกะการทำงาน (Base64, ใช้เมื่อ type=work_cycle) | - |
holiday_flag_lv | string | No | รหัสประเภทวันหยุด (ใช้เมื่อ type=holiday) | "01" |
language_code | string | No | ภาษา: TH หรือ EN | "TH" |
Filter Types
| Type | Description |
|---|---|
"leave" | ลางาน — แสดงเฉพาะพนักงานที่ลางาน |
"work_cycle" | กะการทำงาน — แสดงพนักงานตามกะที่ระบุ |
"holiday" | วันหยุด — แสดงเฉพาะพนักงานที่มีวันหยุด |
Leave Types (time_leave_flag)
| Code | Description |
|---|---|
"01" | ลากิจได้รับค่าจ้าง |
"02" | ลากิจไม่ได้รับค่าจ้าง |
"03" | ลาป่วยมีใบรับรองแพทย์ |
"06" | ลาพักร้อน |
"09" | ขาดงาน |
Holiday Types (holiday_flag_lv)
| Code | Description |
|---|---|
"01" | วันหยุดนักขัตฤกษ์ |
"03" | วันหยุดพนักงาน |
"04" | วันหยุดพิเศษ |
Response Format
Success Response (type=leave)
{
"code": 200,
"message": "Get Calendar Month Accept",
"payload": {
"2026-02-03": [
{
"employee_code": "EMP001",
"employee_name": "สมชาย",
"employee_last_name": "ใจดี",
"position_name": "โปรแกรมเมอร์",
"department_name": "ฝ่ายพัฒนา",
"organization": {
"company": { "label": "บริษัท", "value": "บริษัท ตัวอย่าง จำกัด" },
"branch": { "label": "สาขา", "value": "สำนักงานใหญ่" },
"department": { "label": "แผนก", "value": "ฝ่ายพัฒนา" }
},
"work_date": "2026-02-03"
}
]
}
}Success Response (type=work_cycle or holiday)
Response จะมี fields เพิ่มเติม: work_cycle_code, work_cycle_start_time, work_cycle_end_time, absence_flag_lv, day_status
Error Response
{
"code": 400,
"message": "ไม่สำเร็จ",
"errors": { "type": "Invalid type. Expected: leave, work_cycle, or holiday" }
}Code Examples
cURL
# ดูปฏิทินการลาในเดือนกุมภาพันธ์
curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/salary/get-data-filter?path_action=get_calendar_month_filter&start_date=2026-02-01&end_date=2026-02-28&type=leave&language_code=TH" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"
# ดูปฏิทินวันหยุดนักขัตฤกษ์ในไตรมาสแรก
curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/salary/get-data-filter?path_action=get_calendar_month_filter&start_date=2026-01-01&end_date=2026-03-31&type=holiday&holiday_flag_lv=01&language_code=TH" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Notes
- API นี้ต้องระบุ
typeเสมอ (ไม่สามารถเป็น null ได้ — ต่างจาก Get Calendar Month) - สำหรับ type=leave ระบบจะ expand เอกสารลาข้ามวันเป็นรายวัน
- แนะนำให้จำกัดช่วงวันที่ไม่เกิน 3 เดือนเพื่อประสิทธิภาพ
- Response สำหรับ type=leave จะไม่มี work_cycle fields
Related APIs
- Get Calendar Month - ดูปฏิทินตามรอบเงินเดือน (รองรับ type=null)
Last updated on