Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Get Employee Cost Center

ดึงข้อมูลศูนย์ต้นทุนประจำสัปดาห์ของพนักงาน

Endpoint

GET /api/v1/open-apis/employee/get-employee-data-filter?path_action=get-cost-center

Query Parameters

ParameterTypeRequiredDescription
path_actionstringYesต้องเป็น get-cost-center
employee_codestringYesรหัสพนักงาน

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


Response Format

Success Response

{ "code": 200, "message": "สำเร็จ", "payload": { "Mon": { "day": "Mon", "cost_center_id": "CC001", "cost_center_info": { "name": "สำนักงานใหญ่" } }, "Tue": { "day": "Tue", "cost_center_id": "CC001", "cost_center_info": { "name": "สำนักงานใหญ่" } }, "Wed": { "day": "Wed", "cost_center_id": "CC001", "cost_center_info": { "name": "สำนักงานใหญ่" } }, "Thu": { "day": "Thu", "cost_center_id": "CC001", "cost_center_info": { "name": "สำนักงานใหญ่" } }, "Fri": { "day": "Fri", "cost_center_id": "CC001", "cost_center_info": { "name": "สำนักงานใหญ่" } }, "Sat": { "day": "Sat", "cost_center_id": "", "cost_center_info": null }, "Sun": { "day": "Sun", "cost_center_id": "", "cost_center_info": null } } }

Response Fields

payload เป็น Object ที่ key คือชื่อวัน (Mon-Sun) แต่ละวันมีฟิลด์:

FieldTypeDescription
daystringชื่อวัน (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
cost_center_idstringรหัสศูนย์ต้นทุน (ว่าง = ไม่กำหนด)
cost_center_infoobject/nullข้อมูลศูนย์ต้นทุน (null = ไม่กำหนด)
cost_center_info.namestringชื่อศูนย์ต้นทุน

Error Response

{ "code": 400, "message": "ไม่สำเร็จ", "error": "Employee not found with code: EMP999" }
เงื่อนไขError Message
ไม่ส่ง employee_code หรือว่างMissing required parameter: employee_code
หา employee ไม่เจอEmployee not found with code: xxx

Code Examples

curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/employee/get-employee-data-filter?path_action=get-cost-center&employee_code=EMP001" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -H "Content-Type: application/json"

  • Update Cost Center - บันทึกศูนย์ต้นทุนของพนักงาน
Last updated on