Update Employee Address
แก้ไขที่อยู่ของพนักงาน ทั้งที่อยู่ตามทะเบียนบ้านและที่อยู่ปัจจุบัน
Endpoint
POST /api/v1/open-apis/employee/update-employee-profile?path_action=save-addressQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path_action | string | Yes | ใช้ address หรือ save-address |
Request Body
Base Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
employee_code | string | Yes | รหัสพนักงาน |
ที่อยู่ตามทะเบียนบ้าน
| Parameter | Type | Required | Description |
|---|---|---|---|
address | string | No | ที่อยู่ตามทะเบียนบ้าน |
country_code | string | No | รหัสประเทศ |
state_code | string | No | รหัสจังหวัด |
district_code | string | No | รหัสอำเภอ/เขต |
subdistrict_code | string | No | รหัสตำบล/แขวง |
post_code | string | No | รหัสไปรษณีย์ |
ที่อยู่ปัจจุบัน
| Parameter | Type | Required | Description |
|---|---|---|---|
current_address | string | No | ที่อยู่ปัจจุบัน |
current_country_code | string | No | รหัสประเทศปัจจุบัน |
current_state_code | string | No | รหัสจังหวัดปัจจุบัน |
current_district_code | string | No | รหัสอำเภอ/เขตปัจจุบัน |
current_subdistrict_code | string | No | รหัสตำบล/แขวงปัจจุบัน |
current_post_code | string | No | รหัสไปรษณีย์ปัจจุบัน |
Response Format
Success Response
{
"code": 200,
"message": "Update Address Success",
"payload": {
"employee_id": "20260121EM01A2B3C4D5",
"address": "99/1 ถนนนเรศวร",
"country_code": "TH",
"state_code": "65",
"district_code": "6501",
"subdistrict_code": "650101",
"post_code": "65000",
"current_address": "99/1 ถนนนเรศวร",
"current_country_code": "TH",
"current_state_code": "65",
"current_district_code": "6501",
"current_subdistrict_code": "650101",
"current_post_code": "65000"
}
}Error Response
{
"code": 400,
"message": "Validation failed",
"errors": ["Missing required parameter: 'employee_code'"]
}Code Examples
cURL
curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/update-employee-profile?path_action=save-address" \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-d '{
"employee_code": "EMP001",
"address": "99/1 ถนนนเรศวร",
"country_code": "TH",
"state_code": "65",
"district_code": "6501",
"subdistrict_code": "650101",
"post_code": "65000",
"current_address": "99/1 ถนนนเรศวร",
"current_country_code": "TH",
"current_state_code": "65",
"current_district_code": "6501",
"current_subdistrict_code": "650101",
"current_post_code": "65000"
}'Notes
- ฟิลด์ทั้งหมดเป็น Optional ยกเว้น
employee_code- ถ้าไม่ระบุจะคงค่าเดิม - สามารถอัพเดทเฉพาะที่อยู่ตามทะเบียนบ้าน หรือเฉพาะที่อยู่ปัจจุบันได้
- รหัสไปรษณีย์จะถูก resolve อัตโนมัติจาก
subdistrict_code(ถ้ามี)
Related APIs
- Get Employee Info - ดึงข้อมูลพนักงาน (รวมที่อยู่)
- Get Employee Data - ดึงข้อมูลพนักงานแบบละเอียด
Last updated on