Excel Receiving Import
นำเข้าข้อมูลโควตาการลาที่จะได้รับ (Receiving Quota) จากไฟล์ Excel (.xlsx) เข้าสู่ระบบ ใช้สำหรับวางแผนโควตาที่พนักงานจะได้รับในอนาคต
Endpoint
POST /api/v1/open-apis/salary/add-data-filter?path_action=excel_receiving_importRequest Body (multipart/form-data)
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
_fileUpd | file | Yes | ไฟล์ Excel (.xlsx) | receiving_quota.xlsx |
select_year | string | Yes | ปีโควตา (YYYY) | "2027" |
Content-Type ต้องเป็น multipart/form-data (ไม่ใช่ application/json)
Response Format
Success Response
{
"code": 200,
"message": "Import Receiving Quota Success",
"payload": {
"all_record": 200,
"insert_record": 195,
"update_record": 5,
"error_record": 0
}
}Response Fields
| Field | Type | Description |
|---|---|---|
all_record | number | จำนวนรายการทั้งหมดในไฟล์ |
insert_record | number | จำนวนรายการที่เพิ่มสำเร็จ |
update_record | number | จำนวนรายการที่อัปเดตสำเร็จ |
error_record | number | จำนวนรายการที่เกิดข้อผิดพลาด |
Error Response
{
"code": 400,
"message": "ไม่สำเร็จ",
"errors": ["กรุณาอัปโหลดไฟล์ (_fileUpd)"]
}Code Examples
cURL
curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/salary/add-data-filter?path_action=excel_receiving_import" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-F "_fileUpd=@/path/to/receiving_quota.xlsx" \
-F "select_year=2027"Notes
- โควตาที่จะได้รับ (Receiving Quota) คือโควตาที่พนักงานจะได้รับในอนาคต ไม่ใช่โควตาปัจจุบัน
- ไฟล์ต้องเป็น
.xlsxเท่านั้น - ดาวน์โหลด template จาก Excel Receiving Template ก่อนกรอกข้อมูล
- ระบบจะสร้าง import log อัตโนมัติเพื่อติดตามผลการนำเข้า
- ถ้ามี
error_record> 0 แนะนำให้ตรวจสอบข้อมูลในไฟล์และลองนำเข้าใหม่
Related APIs
- Excel Receiving Template - ดาวน์โหลด template สำหรับนำเข้า
- Get Receiving Import Log - ประวัติการนำเข้าโควตาที่จะได้รับ
- Excel Import - นำเข้าโควตาปกติจาก Excel
Last updated on