Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Import File Log

อัปโหลดไฟล์ Import สวัสดิการและสร้าง Import Log โดยยังไม่ประมวลผลข้อมูลในไฟล์ ใช้สำหรับบันทึกไฟล์ไว้ก่อนแล้วค่อยประมวลผลภายหลัง

Endpoint

POST /api/v1/open-apis/welfare/excel_import_file_log

Content-Type: multipart/form-data

Request Body

ParameterTypeRequiredDescriptionExample
_fileUpdfileYesไฟล์ที่ต้องการอัปโหลด (แนะนำ .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

FieldTypeNullableDescription
import_log_typestringNoประเภท import (= "welfare")
import_log_file_dtstringNoเวลาอัปโหลด
import_log_file_namestringNoชื่อไฟล์ที่เก็บในระบบ
import_log_file_pathstringNoURL ไฟล์ที่อัปโหลด
error_logstringYesURL ไฟล์ log (มีเฉพาะกรณี extension เป็น .xlsx)

Error Response - Missing File (HTTP 400)

{ "code": 400, "message": "Exception File type not support" }

Code Examples

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 จะถูกสร้างแบบสุ่มโดยระบบ
  • Excel Import - อัปโหลด + ประมวลผล Excel เพื่อสร้าง/แทนที่ Config
  • Import JSON - ส่งข้อมูลแถวที่ parse แล้วเป็น JSON เพื่อสร้าง/แทนที่ Config
  • Excel Template - ดาวน์โหลด template ก่อนกรอก/อัปโหลด
Last updated on