Add Employee Profile
Router สำหรับเพิ่มข้อมูลส่วนตัวพนักงาน รองรับการเรียกใช้งานแบบแยกเรื่องผ่าน path_action parameter
API นี้ใช้ Router Pattern - ระบุ path_action เพื่อเลือกประเภท Profile ที่ต้องการเพิ่ม
Endpoint
POST /api/v1/open-apis/employee/add-employee-profileQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path_action | string | Yes | ประเภทข้อมูลที่ต้องการเพิ่ม |
Base Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
employee_code | string | Yes | รหัสพนักงาน |
ใช้ employee_code เพื่อระบุพนักงาน
พารามิเตอร์ที่ลงท้ายด้วย _id ต้องส่งเป็น Base64-encoded ของ raw internal ID
- Response จะ return raw string ID (เช่น
20260121FC89F3BB9120) - เมื่อนำ ID จาก response ไปใช้ใน request ถัดไป ต้อง encode เป็น Base64 ก่อน
Supported Actions
| path_action | Description | Category |
|---|---|---|
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 - เพิ่มข้อมูลครอบครัว
| Parameter | Type | Required | Description |
|---|---|---|---|
relation_type | string | Yes | ประเภทความสัมพันธ์ |
family_title_lv | string | No | คำนำหน้าชื่อ |
family_name | string | Yes | ชื่อ |
family_last_name | string | Yes | นามสกุล |
family_id_no | string | No | เลขบัตรประชาชน |
family_birthday | string | No | วันเกิด (YYYY-MM-DD) |
education - เพิ่มประวัติการศึกษา
| Parameter | Type | Required | Description |
|---|---|---|---|
education_level | string | Yes | ระดับการศึกษา |
education_place | string | Yes | สถาบันการศึกษา |
education_major | string | No | สาขาวิชา |
education_year | string | No | ปีที่จบ |
education_grade | string | No | เกรดเฉลี่ย |
work - เพิ่มประวัติการทำงาน
| Parameter | Type | Required | Description |
|---|---|---|---|
work_company | string | Yes | ชื่อบริษัท |
work_position | string | No | ตำแหน่ง |
work_date_from | string | No | วันที่เริ่ม (YYYY-MM-DD) |
work_date_to | string | No | วันที่สิ้นสุด (YYYY-MM-DD) |
work_salary | string | No | เงินเดือน |
work_why_signout | string | No | เหตุผลที่ลาออก |
ability - เพิ่มความสามารถพิเศษ
| Parameter | Type | Required | Description |
|---|---|---|---|
ability_list | string | Yes | รายละเอียดความสามารถ |
language-skill - เพิ่มทักษะภาษา
| Parameter | Type | Required | Description |
|---|---|---|---|
language_name | string | Yes | ชื่อภาษา |
writing_level | string | No | ระดับการเขียน |
speaking_level | string | No | ระดับการพูด |
reading_level | string | No | ระดับการอ่าน |
typing-skill - เพิ่มทักษะพิมพ์ดีด
| Parameter | Type | Required | Description |
|---|---|---|---|
language_name | string | Yes | ภาษาที่พิมพ์ |
typing_speed | string | No | ความเร็ว (คำ/นาที) |
driving-skill - เพิ่มทักษะการขับขี่
| Parameter | Type | Required | Description |
|---|---|---|---|
vehicle_name | string | Yes | ประเภทยานพาหนะ |
skill_level | string | No | ระดับความชำนาญ (Y/N) |
certificate_no | string | No | เลขที่ใบอนุญาต |
certificate_expire_dt | string | No | วันหมดอายุ |
training - เพิ่มประวัติการฝึกอบรม
| Parameter | Type | Required | Description |
|---|---|---|---|
training_name | string | Yes | ชื่อหลักสูตร |
training_date | string | No | วันที่อบรม |
training_hour | string | No | จำนวนชั่วโมง |
training_price | string | No | ค่าใช้จ่าย |
training_location | string | No | สถานที่อบรม |
possess - เพิ่มทรัพย์สินครอบครอง
| Parameter | Type | Required | Description |
|---|---|---|---|
possess_name | string | Yes | ชื่อทรัพย์สิน |
possess_date | string | No | วันที่รับ |
possess_price | string | No | มูลค่า |
possess-image - เพิ่มรูปภาพทรัพย์สิน
| Parameter | Type | Required | Description |
|---|---|---|---|
employee_possess_id | string | Yes | ID ของทรัพย์สิน |
image_64 | string | Yes* | รูปภาพ Base64 |
_image | file | Yes* | ไฟล์รูปภาพ (multipart/form-data) |
*ระบุอย่างใดอย่างหนึ่ง
hospital - เพิ่มโรงพยาบาลตามสิทธิ
| Parameter | Type | Required | Description |
|---|---|---|---|
hospital_name | string | Yes | ชื่อโรงพยาบาล |
hospital_link_flag | string | No | สถานะการเชื่อมต่อ |
document - เพิ่มเอกสาร
ต้องใช้ Content-Type: multipart/form-data สำหรับการ upload เอกสาร
| Parameter | Type | Required | Description |
|---|---|---|---|
documents_name | string | Yes | ชื่อเอกสาร |
documents_code | string | No | รหัสเอกสาร |
documents_expired | string | No | วันหมดอายุ |
documents_effective | string | No | วันที่มีผล |
_doc | file | Yes | ไฟล์เอกสาร |
Response Format
Success Response
{
"code": 200,
"message": "สำเร็จ",
"payload": {
"id": "20260121FC89F3BB9120"
}
}Error Response
{
"code": 400,
"message": "ข้อมูลไม่ถูกต้อง",
"errors": [
"กรุณาระบุ 'path_action'",
"กรุณาระบุ 'employee_code'"
]
}Code Examples
cURL
# เพิ่มข้อมูลครอบครัว
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
| Error | Solution |
|---|---|
| กรุณาระบุ ‘path_action’ | ต้องระบุ path_action ใน query parameter |
| กรุณาระบุ ‘employee_code’ | ต้องระบุ employee_code |
| ไม่พบไฟล์สำหรับ action | ตรวจสอบว่า path_action ตรงกับรายการที่รองรับ |
Related APIs
- Update Employee Profile - แก้ไขข้อมูล Profile
- Delete Employee Profile - ลบข้อมูล Profile
- Get Employee Info - ดึงข้อมูลพนักงาน (รวม Profile)
Last updated on