Update Employee Hospital
แก้ไขโรงพยาบาลตามสิทธิของพนักงาน
Endpoint
POST /api/v1/open-apis/employee/update-employee-profile?path_action=save-hospitalQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path_action | string | Yes | ต้องเป็น save-hospital |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
employee_hospital_id | string | Yes | ID ของโรงพยาบาลตามสิทธิ (ต้อง encode Base64) |
hospital_name | string | No | ชื่อโรงพยาบาล |
hospital_link_flag | string | No | ประเภทสิทธิ (01, 02, 03) |
พารามิเตอร์ employee_hospital_id ต้อง encode เป็น Base64 ก่อนส่ง Response field employee_hospital_id จะเป็น Plain text ไม่ได้ encode Base64
Option Values
hospital_link_flag
| Value | Description (TH) | Description (EN) |
|---|---|---|
01 | ประกันสังคม | Social Security |
02 | ประกันอื่นๆ | Insurance Other |
03 | สวัสดิการ | Welfare |
Response Format
Success Response
{
"code": 200,
"message": "Update Hospital Success",
"payload": {
"employee_hospital_id": "20260121HP01D2E3F4A5",
"hospital_name": "โรงพยาบาลบำรุงราษฎร์",
"hospital_link_flag": "02"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
employee_hospital_id | string | ID ของโรงพยาบาล (Plain text) |
hospital_name | string | ชื่อโรงพยาบาลที่อัพเดท |
hospital_link_flag | string | ประเภทสิทธิที่อัพเดท |
Error Response
{
"code": 400,
"message": "Validation failed",
"errors": ["Missing required parameter: 'employee_hospital_id'"]
}Validation Rules
| Field | Rule |
|---|---|
employee_hospital_id | ต้องระบุ, ต้อง encode Base64, ต้องมีข้อมูลในระบบ |
hospital_name | ไม่บังคับ |
hospital_link_flag | ไม่บังคับ ถ้าระบุต้องเป็นค่า 01, 02, 03 |
Code Examples
cURL
curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/update-employee-profile?path_action=save-hospital" \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-d '{
"employee_hospital_id": "MjAyNjAxMjFIUDAxRDJFM0Y0QTU=",
"hospital_name": "โรงพยาบาลบำรุงราษฎร์",
"hospital_link_flag": "02"
}'Notes
- สามารถอัพเดทเฉพาะฟิลด์ที่ต้องการเปลี่ยนแปลง หากไม่ส่งฟิลด์ใดระบบจะคงค่าเดิมไว้
- ระบบจะอัพเดท
last_updtimestamp อัตโนมัติ
Related APIs
- List Hospitals - ดึงรายการโรงพยาบาลตามสิทธิทั้งหมด
- Get Hospital - ดึงข้อมูลโรงพยาบาลตามสิทธิตาม ID
- Add Hospital - เพิ่มโรงพยาบาลตามสิทธิ
- Delete Hospital - ลบโรงพยาบาลตามสิทธิ
Last updated on