Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Get Employee Data

ดึงข้อมูลพนักงานตามประเภทที่ต้องการ (Setting, Profile, Financial หรือทั้งหมด) เหมาะสำหรับกรณีที่ต้องการเฉพาะบางหมวดข้อมูล

API นี้ให้ความยืดหยุ่นในการเลือกดึงข้อมูลเฉพาะหมวดที่ต้องการ ช่วยลดขนาด response และเพิ่มประสิทธิภาพ

พารามิเตอร์ที่ลงท้ายด้วย _id ต้องส่งเป็น Base64-encoded ของ raw internal ID

  • Response จะ return raw string ID (เช่น 20260121FC89F3BB9120)
  • เมื่อนำ ID จาก response ไปใช้ใน request ถัดไป ต้อง encode เป็น Base64 ก่อน

Endpoint

GET /api/v1/open-apis/employee/get-employee-data

Query Parameters

ParameterTypeRequiredDescriptionExample
employee_codestringYesรหัสพนักงานที่ต้องการดึงข้อมูลEMP001
typestringYesประเภทข้อมูลที่ต้องการall
welfare_yearstringNoปีสวัสดิการ (สำหรับ financial)2026

Type Options

TypeDescriptionReturns
allข้อมูลทั้งหมดsetting + profile + financial
settingการตั้งค่าพนักงานsetting fields only
profileข้อมูลส่วนตัวprofile fields only
financialข้อมูลการเงินfinancial fields only

Response Format

Success Response (HTTP 200)

Type = all

{ "code": 200, "message": "สำเร็จ", "payload": { "setting": { "general": {...}, "approver_lists": [...], "user_lists": {...}, "work_cycle_lists": {...}, "holiday_lists": {...}, "ot_lists": {...}, "quota_lists": {...}, "worktime_configs": {...}, "facial": [...], "time_frame_lists": {...}, "cost_center_lists": [...], "role_duty_lists": {...} }, "profile": { "address": {...}, "family_lists": [...], "work_lists": [...], "education_lists": [...], "ability_lists": [...], "language_skill_lists": [...], "typing_skill_lists": [...], "driving_skill_lists": [...], "document_lists": [...], "trainning_lists": [...], "possess_lists": [...], "loan_lists": [...], "hospital_lists": [...] }, "financial": { "tax_lists": [...], "fund_lists": [...], "work_insurance_lists": [...], "welfare_lists": [...], "constant_lists": [...], "salary_auto_checked_lists": [...] } } }

Error Response (HTTP 400)

{ "code": 400, "message": "ไม่สำเร็จ", "error": "Employee profile not found for id: INVALID_ID" }

Response Fields by Type

Setting Fields

FieldTypeDescription
generalobjectตั้งค่าทั่วไป (วันทำงาน, ชั่วโมงทำงาน)
approver_listsarrayรายการผู้อนุมัติ
user_listsobjectข้อมูลบัญชีผู้ใช้งาน
work_cycle_listsobjectกะการทำงานรายวัน (Mon-Sun)
holiday_listsobjectวันหยุดรายวัน
ot_listsobjectประเภท OT ที่อนุญาต
quota_listsobjectโควตาการลา + อายุงาน
worktime_configsobjectการตั้งค่าเวลาทำงาน
facialarrayข้อมูลใบหน้า
time_frame_listsobjectกรอบเวลา
cost_center_listsarrayศูนย์ต้นทุน
role_duty_listsobjectหน้าที่ปฏิบัติงาน

Profile Fields

FieldTypeDescription
addressobjectที่อยู่ + ข้อมูลพื้นฐาน
family_listsarrayข้อมูลครอบครัว
work_listsarrayประวัติการทำงาน
education_listsarrayประวัติการศึกษา
ability_listsarrayความสามารถพิเศษ
language_skill_listsarrayทักษะภาษา
typing_skill_listsarrayทักษะการพิมพ์
driving_skill_listsarrayทักษะการขับขี่
document_listsarrayเอกสาร
trainning_listsarrayประวัติฝึกอบรม
possess_listsarrayทรัพย์สิน
loan_listsarrayเงินกู้
hospital_listsarrayโรงพยาบาล

Financial Fields

FieldTypeDescription
tax_listsarrayข้อมูลภาษีรายปี
fund_listsarrayกองทุนสำรองเลี้ยงชีพ
work_insurance_listsarrayประกันสังคม
welfare_listsarrayสวัสดิการ
constant_listsarrayรายรับ/รายจ่ายคงที่
salary_auto_checked_listsarrayรายการตรวจสอบเงินเดือน

Code Examples

# ดึงข้อมูลทั้งหมด curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/employee/get-employee-data?employee_code=EMP001&type=all" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" # ดึงเฉพาะ Setting curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/employee/get-employee-data?employee_code=EMP001&type=setting" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" # ดึงเฉพาะ Profile curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/employee/get-employee-data?employee_code=EMP001&type=profile" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" # ดึงเฉพาะ Financial พร้อมระบุปีสวัสดิการ curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/employee/get-employee-data?employee_code=EMP001&type=financial&welfare_year=2026" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"

Notes

เมื่อไหร่ควรใช้ type=all:

  • เมื่อต้องการดึงข้อมูลทั้งหมดในครั้งเดียว
  • เมื่อต้องการแสดงหน้ารวมข้อมูลพนักงาน
  • ลด API calls จาก 3 ครั้ง เหลือ 1 ครั้ง

ข้อควรระวัง:

  • Response มีขนาดใหญ่กว่าปกติเมื่อใช้ type=all
  • ใช้เวลาประมวลผลนานกว่า type เดี่ยว
  • ถ้าต้องการเฉพาะบางส่วน ใช้ type=setting, type=profile, หรือ type=financial แทน

Difference from Get Employee Info

FeatureGet Employee InfoGet Employee Data
Parameteremployee_codeemployee_code
ResponseFixed structure (18 lists)Flexible by type
Use Caseแสดงข้อมูลครบถ้วนเลือกดึงเฉพาะหมวด

  • Get Employee Info - ดึงข้อมูลครบถ้วนโดยใช้ employee_code
  • Get Employee List - ดึงรายการพนักงานทั้งหมด
  • Update Employee - แก้ไขข้อมูลพนักงาน
Last updated on