Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Add Employee Profile

Router สำหรับเพิ่มข้อมูลส่วนตัวพนักงาน รองรับการเรียกใช้งานแบบแยกเรื่องผ่าน path_action parameter

API นี้ใช้ Router Pattern - ระบุ path_action เพื่อเลือกประเภท Profile ที่ต้องการเพิ่ม

Endpoint

POST /api/v1/open-apis/employee/add-employee-profile

Query Parameters

ParameterTypeRequiredDescription
path_actionstringYesประเภทข้อมูลที่ต้องการเพิ่ม

Base Parameters

ParameterTypeRequiredDescription
employee_codestringYesรหัสพนักงาน

ใช้ employee_code เพื่อระบุพนักงาน

พารามิเตอร์ที่ลงท้ายด้วย _id ต้องส่งเป็น Base64-encoded ของ raw internal ID

  • Response จะ return raw string ID (เช่น 20260121FC89F3BB9120)
  • เมื่อนำ ID จาก response ไปใช้ใน request ถัดไป ต้อง encode เป็น Base64 ก่อน

Supported Actions

path_actionDescriptionCategory
familyเพิ่มข้อมูลครอบครัวPersonal
workเพิ่มประวัติการทำงานExperience
educationเพิ่มประวัติการศึกษาExperience
abilityเพิ่มความสามารถพิเศษSkills
language-skillเพิ่มทักษะภาษาSkills
typing-skillเพิ่มทักษะพิมพ์ดีดSkills
driving-skillเพิ่มทักษะการขับขี่Skills
trainingเพิ่มประวัติการฝึกอบรมExperience
possessเพิ่มทรัพย์สินครอบครองAssets
possess-imageเพิ่มรูปภาพทรัพย์สินAssets
hospitalเพิ่มโรงพยาบาลตามสิทธิBenefits
documentเพิ่มเอกสารDocuments

Action Details

family - เพิ่มข้อมูลครอบครัว

ParameterTypeRequiredDescription
relation_typestringYesประเภทความสัมพันธ์
family_title_lvstringNoคำนำหน้าชื่อ
family_namestringYesชื่อ
family_last_namestringYesนามสกุล
family_id_nostringNoเลขบัตรประชาชน
family_birthdaystringNoวันเกิด (YYYY-MM-DD)

education - เพิ่มประวัติการศึกษา

ParameterTypeRequiredDescription
education_levelstringYesระดับการศึกษา
education_placestringYesสถาบันการศึกษา
education_majorstringNoสาขาวิชา
education_yearstringNoปีที่จบ
education_gradestringNoเกรดเฉลี่ย

work - เพิ่มประวัติการทำงาน

ParameterTypeRequiredDescription
work_companystringYesชื่อบริษัท
work_positionstringNoตำแหน่ง
work_date_fromstringNoวันที่เริ่ม (YYYY-MM-DD)
work_date_tostringNoวันที่สิ้นสุด (YYYY-MM-DD)
work_salarystringNoเงินเดือน
work_why_signoutstringNoเหตุผลที่ลาออก

ability - เพิ่มความสามารถพิเศษ

ParameterTypeRequiredDescription
ability_liststringYesรายละเอียดความสามารถ

language-skill - เพิ่มทักษะภาษา

ParameterTypeRequiredDescription
language_namestringYesชื่อภาษา
writing_levelstringNoระดับการเขียน
speaking_levelstringNoระดับการพูด
reading_levelstringNoระดับการอ่าน

typing-skill - เพิ่มทักษะพิมพ์ดีด

ParameterTypeRequiredDescription
language_namestringYesภาษาที่พิมพ์
typing_speedstringNoความเร็ว (คำ/นาที)

driving-skill - เพิ่มทักษะการขับขี่

ParameterTypeRequiredDescription
vehicle_namestringYesประเภทยานพาหนะ
skill_levelstringNoระดับความชำนาญ (Y/N)
certificate_nostringNoเลขที่ใบอนุญาต
certificate_expire_dtstringNoวันหมดอายุ

training - เพิ่มประวัติการฝึกอบรม

ParameterTypeRequiredDescription
training_namestringYesชื่อหลักสูตร
training_datestringNoวันที่อบรม
training_hourstringNoจำนวนชั่วโมง
training_pricestringNoค่าใช้จ่าย
training_locationstringNoสถานที่อบรม

possess - เพิ่มทรัพย์สินครอบครอง

ParameterTypeRequiredDescription
possess_namestringYesชื่อทรัพย์สิน
possess_datestringNoวันที่รับ
possess_pricestringNoมูลค่า

possess-image - เพิ่มรูปภาพทรัพย์สิน

ParameterTypeRequiredDescription
employee_possess_idstringYesID ของทรัพย์สิน
image_64stringYes*รูปภาพ Base64
_imagefileYes*ไฟล์รูปภาพ (multipart/form-data)

*ระบุอย่างใดอย่างหนึ่ง

hospital - เพิ่มโรงพยาบาลตามสิทธิ

ParameterTypeRequiredDescription
hospital_namestringYesชื่อโรงพยาบาล
hospital_link_flagstringNoสถานะการเชื่อมต่อ

document - เพิ่มเอกสาร

ต้องใช้ Content-Type: multipart/form-data สำหรับการ upload เอกสาร

ParameterTypeRequiredDescription
documents_namestringYesชื่อเอกสาร
documents_codestringNoรหัสเอกสาร
documents_expiredstringNoวันหมดอายุ
documents_effectivestringNoวันที่มีผล
_docfileYesไฟล์เอกสาร

Response Format

Success Response

{ "code": 200, "message": "สำเร็จ", "payload": { "id": "20260121FC89F3BB9120" } }

Error Response

{ "code": 400, "message": "ข้อมูลไม่ถูกต้อง", "errors": [ "กรุณาระบุ 'path_action'", "กรุณาระบุ 'employee_code'" ] }

Code Examples

# เพิ่มข้อมูลครอบครัว curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/add-employee-profile?path_action=family" \ -H "Content-Type: application/json" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -d '{ "employee_code": "EMP001", "relation_type": "04", "family_name": "สมชาย", "family_last_name": "ใจดี", "family_birthday": "2010-05-15" }' # เพิ่มประวัติการศึกษา curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/add-employee-profile?path_action=education" \ -H "Content-Type: application/json" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -d '{ "employee_code": "EMP001", "education_level": "07", "education_place": "มหาวิทยาลัยเกษตรศาสตร์", "education_major": "วิทยาการคอมพิวเตอร์", "education_year": "2563", "education_grade": "3.50" }' # เพิ่มทักษะภาษา curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/add-employee-profile?path_action=language-skill" \ -H "Content-Type: application/json" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -d '{ "employee_code": "EMP001", "language_name": "ภาษาอังกฤษ", "writing_level": "01", "speaking_level": "02", "reading_level": "01" }' # เพิ่มเอกสาร (multipart/form-data) curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/add-employee-profile?path_action=document" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -F "employee_code=EMP001" \ -F "documents_name=บัตรประชาชน" \ -F "documents_code=ID_CARD" \ -F "_doc=@/path/to/document.pdf"

Troubleshooting

ErrorSolution
กรุณาระบุ ‘path_action’ต้องระบุ path_action ใน query parameter
กรุณาระบุ ‘employee_code’ต้องระบุ employee_code
ไม่พบไฟล์สำหรับ actionตรวจสอบว่า path_action ตรงกับรายการที่รองรับ

Last updated on