Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Excel Receiving Import

นำเข้าข้อมูลโควตาการลาที่จะได้รับ (Receiving Quota) จากไฟล์ Excel (.xlsx) เข้าสู่ระบบ ใช้สำหรับวางแผนโควตาที่พนักงานจะได้รับในอนาคต

Endpoint

POST /api/v1/open-apis/salary/add-data-filter?path_action=excel_receiving_import

Request Body (multipart/form-data)

ParameterTypeRequiredDescriptionExample
_fileUpdfileYesไฟล์ Excel (.xlsx)receiving_quota.xlsx
select_yearstringYesปีโควตา (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

FieldTypeDescription
all_recordnumberจำนวนรายการทั้งหมดในไฟล์
insert_recordnumberจำนวนรายการที่เพิ่มสำเร็จ
update_recordnumberจำนวนรายการที่อัปเดตสำเร็จ
error_recordnumberจำนวนรายการที่เกิดข้อผิดพลาด

Error Response

{ "code": 400, "message": "ไม่สำเร็จ", "errors": ["กรุณาอัปโหลดไฟล์ (_fileUpd)"] }

Code Examples

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 แนะนำให้ตรวจสอบข้อมูลในไฟล์และลองนำเข้าใหม่

  • Excel Receiving Template - ดาวน์โหลด template สำหรับนำเข้า
  • Get Receiving Import Log - ประวัติการนำเข้าโควตาที่จะได้รับ
  • Excel Import - นำเข้าโควตาปกติจาก Excel
Last updated on