Excel Template
ดาวน์โหลดไฟล์ Excel template สำหรับนำเข้าข้อมูลโควตาการลา ใช้สำหรับเตรียมข้อมูลก่อนนำเข้าผ่าน Excel Import API
Endpoint
GET /api/v1/open-apis/salary/get-data-filter?path_action=excel_templateรองรับทั้ง GET และ POST method — สามารถส่ง filter ผ่าน Query String หรือ Request Body ได้
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
quota_year | string | No | ปีโควตา (YYYY) | "2026" |
company_id | string | No | กรองตามบริษัท (Base64) | - |
branch_id | string | No | กรองตามสาขา (Base64) | - |
department_id | string | No | กรองตามแผนก (Base64) | - |
division_id | string | No | กรองตามฝ่าย (Base64) | - |
section_id | string | No | กรองตามหมวด (Base64) | - |
position_id | string | No | กรองตามตำแหน่ง (Base64) | - |
employee_id | string | No | กรองเฉพาะพนักงานคนเดียว (Base64) | - |
keyword | string | No | ค้นหาจากชื่อ-นามสกุล, รหัสพนักงาน | "EMP001" |
employee_type_code | array | No | กรองตามประเภทพนักงาน | ["01", "02"] |
language_code | string | No | ภาษา: TH หรือ EN | "TH" |
Response Format
Success Response
- Content-Type:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - Body: Binary stream ของไฟล์ Excel (.xlsx)
Excel File Structure
| Column | Description | แก้ไขได้ |
|---|---|---|
| รหัสพนักงาน | รหัสพนักงาน (employee_code) | ห้ามแก้ไข |
| สำนักงานสาขา | ชื่อสาขา | ห้ามแก้ไข |
| แผนก | ชื่อแผนก | ห้ามแก้ไข |
| ตำแหน่ง | ชื่อตำแหน่ง | ห้ามแก้ไข |
| ชื่อ-นามสกุล | ชื่อเต็มพนักงาน | ห้ามแก้ไข |
| ลาป่วย (วัน) | จำนวนวันลาป่วย | กรอกได้ |
| ลาป่วย (ชม.) | จำนวนชั่วโมงลาป่วย | กรอกได้ |
| ลากิจ (วัน) | จำนวนวันลากิจ | กรอกได้ |
| ลากิจ (ชม.) | จำนวนชั่วโมงลากิจ | กรอกได้ |
| … | คอลัมน์ประเภทการลาอื่นๆ ตามที่ระบบกำหนด | กรอกได้ |
Error Response
{
"code": 400,
"message": "ไม่สำเร็จ",
"errors": ["quota_year must be 4 digits"]
}Code Examples
cURL
# ดาวน์โหลด template ทั้งหมด
curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/salary/get-data-filter?path_action=excel_template"a_year=2026&language_code=TH" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
--output quota_template.xlsx
# ดาวน์โหลด template เฉพาะแผนก (POST)
curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/salary/get-data-filter?path_action=excel_template&language_code=TH" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"department_id": "MjAyNTEwMDYxOTJGRTg4RTk3QTU=", "employee_type_code": ["01"]}' \
--output quota_template_dept.xlsxNotes
- ห้ามแก้ไขคอลัมน์: รหัสพนักงาน, สำนักงานสาขา, แผนก, ตำแหน่ง, ชื่อ-นามสกุล
- ค่าที่กรอกได้: ตัวเลข 0 หรือมากกว่า (ไม่รองรับค่าลบ)
- ถ้าไม่ส่ง filter ระบบจะดึงพนักงานทั้งหมดตาม context
- ใช้
--outputใน cURL เพื่อบันทึกไฟล์ Excel ลงเครื่อง - กรอกข้อมูลโควตาในคอลัมน์ที่กำหนดแล้วนำเข้าผ่าน Excel Import
Related APIs
- Excel Import - นำเข้าโควตาจากไฟล์ Excel ที่กรอกข้อมูลแล้ว
- Get Import Log - ดูรายการประวัติการนำเข้าโควตา
- Excel Receiving Template - ดาวน์โหลด template สำหรับโควตาที่จะได้รับ
Last updated on