Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Update Employee Profile

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

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

Endpoint

POST /api/v1/open-apis/employee/update-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_actionDescriptionRequired ID
familyแก้ไขข้อมูลครอบครัวemployee_family_id
workแก้ไขประวัติการทำงานemployee_work_id
educationแก้ไขประวัติการศึกษาemployee_education_id
abilityแก้ไขความสามารถพิเศษemployee_ability_id
language-skillแก้ไขทักษะภาษาemployee_language_skill_id
typing-skillแก้ไขทักษะพิมพ์ดีดemployee_typing_skill_id
driving-skillแก้ไขทักษะการขับขี่employee_driving_skill_id
trainingแก้ไขประวัติการฝึกอบรมemployee_training_id
possessแก้ไขทรัพย์สินครอบครองemployee_possess_id
hospitalแก้ไขโรงพยาบาลตามสิทธิemployee_hospital_id
documentแก้ไขเอกสารemployee_documents_id
addressแก้ไขที่อยู่employee_id

Action Details

family - แก้ไขข้อมูลครอบครัว

ParameterTypeRequiredDescription
employee_family_idstringYesID ของข้อมูลครอบครัว
relation_typestringNoประเภทความสัมพันธ์
family_namestringNoชื่อ
family_last_namestringNoนามสกุล
family_birthdaystringNoวันเกิด

education - แก้ไขประวัติการศึกษา

ParameterTypeRequiredDescription
employee_education_idstringYesID ของประวัติการศึกษา
education_levelstringNoระดับการศึกษา
education_placestringNoสถาบันการศึกษา
education_majorstringNoสาขาวิชา
education_yearstringNoปีที่จบ

work - แก้ไขประวัติการทำงาน

ParameterTypeRequiredDescription
employee_work_idstringYesID ของประวัติการทำงาน
work_companystringNoชื่อบริษัท
work_positionstringNoตำแหน่ง
work_date_fromstringNoวันที่เริ่ม
work_date_tostringNoวันที่สิ้นสุด

address - แก้ไขที่อยู่

ParameterTypeRequiredDescription
employee_idstringYesID ของพนักงาน (Base64)
addressstringNoที่อยู่ทะเบียนบ้าน
country_codestringNoรหัสประเทศ
state_codestringNoรหัสจังหวัด
district_codestringNoรหัสอำเภอ/เขต
subdistrict_codestringNoรหัสตำบล/แขวง
post_codestringNoรหัสไปรษณีย์
current_addressstringNoที่อยู่ปัจจุบัน
current_country_codestringNoรหัสประเทศปัจจุบัน
current_state_codestringNoรหัสจังหวัดปัจจุบัน
current_district_codestringNoรหัสอำเภอ/เขตปัจจุบัน
current_subdistrict_codestringNoรหัสตำบล/แขวงปัจจุบัน
current_post_codestringNoรหัสไปรษณีย์ปัจจุบัน

Action address ใช้ employee_code ใน query parameter และ employee_id (Base64) ใน request body

document - แก้ไขเอกสาร

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

ParameterTypeRequiredDescription
employee_documents_idstringYesID ของเอกสาร
documents_namestringNoชื่อเอกสาร
documents_expiredstringNoวันหมดอายุ
_docfileNoไฟล์เอกสารใหม่

Response Format

Success Response

{ "code": 200, "message": "สำเร็จ", "payload": { // ข้อมูลที่แก้ไขสำเร็จ } }

Error Response

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

Code Examples

# แก้ไขข้อมูลครอบครัว curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/update-employee-profile?path_action=family" \ -H "Content-Type: application/json" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -d '{ "employee_code": "EMP001", "employee_family_id": "MjAyNjAxMjFGTTAxQjJDM0Q0RTU=", "family_name": "สมชาย", "family_last_name": "ใจดี" }' # แก้ไขประวัติการศึกษา curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/update-employee-profile?path_action=education" \ -H "Content-Type: application/json" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -d '{ "employee_code": "EMP001", "employee_education_id": "MjAyNjAxMjFFRDAxQTJCM0M0RDU=", "education_place": "มหาวิทยาลัยเกษตรศาสตร์", "education_major": "วิทยาการคอมพิวเตอร์" }' # แก้ไขที่อยู่ curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/update-employee-profile?path_action=address&employee_code=EMP001" \ -H "Content-Type: application/json" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -d '{ "employee_id": "MjAyNjAxMjFGQzg5RjNCQjkxMjA=", "address": "99/1 ถนนนเรศวร", "state_code": "65", "district_code": "6501" }'

Troubleshooting

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

Last updated on