Import File Log
อัปโหลดไฟล์ Import สวัสดิการและสร้าง Import Log โดยยังไม่ประมวลผลข้อมูลในไฟล์ ใช้สำหรับบันทึกไฟล์ไว้ก่อนแล้วค่อยประมวลผลภายหลัง
Endpoint
POST /api/v1/open-apis/welfare/excel_import_file_logContent-Type: multipart/form-data
Request Body
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
_fileUpd | file | Yes | ไฟล์ที่ต้องการอัปโหลด (แนะนำ .xlsx) | @/path/to/import.xlsx |
Response Format
Success Response (HTTP 200)
{
"code": 200,
"message": "สำเร็จ",
"payload": {
"import_log_type": "welfare",
"import_log_file_dt": "2026-03-27 10:30:00",
"import_log_file_name": "AbCdEfGhIj1234567890.xlsx",
"import_log_file_path": "https://example.com/file-import/employee-welfares/20260327/AbCdEfGhIj1234567890.xlsx",
"error_log": "https://example.com/file-import/employee-welfares/20260327/AbCdEfGhIj1234567890_error_log.txt"
}
}Response Fields
| Field | Type | Nullable | Description |
|---|---|---|---|
import_log_type | string | No | ประเภท import (= "welfare") |
import_log_file_dt | string | No | เวลาอัปโหลด |
import_log_file_name | string | No | ชื่อไฟล์ที่เก็บในระบบ |
import_log_file_path | string | No | URL ไฟล์ที่อัปโหลด |
error_log | string | Yes | URL ไฟล์ log (มีเฉพาะกรณี extension เป็น .xlsx) |
Error Response - Missing File (HTTP 400)
{
"code": 400,
"message": "Exception File type not support"
}Code Examples
cURL
curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/welfare/excel_import_file_log" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-F "_fileUpd=@/path/to/import.xlsx"Notes
ข้อควรทราบ:
- Endpoint นี้ ไม่ได้ประมวลผล Excel เพื่อสร้าง/อัปเดตข้อมูลสวัสดิการ — ใช้สำหรับบันทึกไฟล์และ log เท่านั้น
- ถ้าต้องการ Import จริง ให้ใช้ Excel Import หรือ Import JSON
- ฟิลด์
error_logจะถูกสร้างเฉพาะเมื่อ extension เป็น.xlsx - ชื่อไฟล์และ URL จะถูกสร้างแบบสุ่มโดยระบบ
Related APIs
- Excel Import - อัปโหลด + ประมวลผล Excel เพื่อสร้าง/แทนที่ Config
- Import JSON - ส่งข้อมูลแถวที่ parse แล้วเป็น JSON เพื่อสร้าง/แทนที่ Config
- Excel Template - ดาวน์โหลด template ก่อนกรอก/อัปโหลด
Last updated on