Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Get Quota by ID

ดึงข้อมูลโควตาการลารายการเดียวตาม ID เพื่อดูรายละเอียดหรือเตรียมข้อมูลก่อนแก้ไข

Endpoint

GET /api/v1/open-apis/salary/get-data-filter?path_action=get_quota_by_id

Query Parameters

ParameterTypeRequiredDefaultDescriptionExample
path_actionstringYes-ต้องเป็น get_quota_by_id"get_quota_by_id"
quota_idstringYes-รหัสโควตา (Base64 encoded)"MjAyNjAxMDFBQkMxMjM0NTY3ODk="
language_codestringNo"TH"ภาษาสำหรับแสดงผล"TH", "EN"

quota_id ต้องเข้ารหัส Base64 เมื่อส่งใน request โดยสามารถดู quota_id ได้จาก List Quotas หรือ Get Quota by Employee


Response Format

Success Response

{ "code": 200, "message": "สำเร็จ", "payload": { "quota_id": "20260101ABC123456789", "employee_id": "202503219741427917A0", "employee_code": "EMP001", "employee_name": "ธาวัน", "employee_last_name": "รายเดือน", "employee_nickname": "แบ่งงวด", "employee_name_en": "Thawan", "employee_last_name_en": "Intaraprasart", "employee_nickname_en": "Yuri", "quota_year": "2026", "time_leave_flag": "06", "time_leave_flag_name": "ลาพักร้อน", "time_leave_flag_name_en": "Annual Leave", "time_leave_flag_quota": "10.00", "actual": 2.5, "remaining": 7.5, "unit": "วัน", "company_id": "20241225C3024958C974", "company_name": "บริษัท ABC จำกัด", "branch_id": "202412254358646B34E4", "branch_name": "สาขากรุงเทพ", "department_id": "20251006192FE88E97A5", "department_name": "ฝ่ายบริหาร", "position_id": "2024122587C216DA2C19", "position_name": "ผู้จัดการ", "created": "2026-01-10 10:30:00", "updated": "2026-02-15 14:20:00" } }

Response Fields

FieldTypeNullableDescription
quota_idstringNoID โควตา (plain text)
employee_idstringNoID พนักงาน (plain text)
employee_codestringNoรหัสพนักงาน
employee_namestringNoชื่อ (ตาม language_code)
employee_last_namestringNoนามสกุล (ตาม language_code)
employee_nicknamestringYesชื่อเล่น (ตาม language_code)
employee_name_enstringNoชื่อ (EN) - ส่งมาเสมอ
employee_last_name_enstringNoนามสกุล (EN) - ส่งมาเสมอ
employee_nickname_enstringYesชื่อเล่น (EN)
quota_yearstringNoปีโควตา (YYYY)
time_leave_flagstringNoรหัสประเภทการลา (01-09)
time_leave_flag_namestringNoชื่อประเภทการลา (ไทย)
time_leave_flag_name_enstringNoชื่อประเภทการลา (อังกฤษ)
time_leave_flag_quotastringNoจำนวนโควตาทั้งหมด (decimal)
actualnumberNoจำนวนที่ใช้ไปแล้ว
remainingnumberNoจำนวนคงเหลือ (quota - actual)
unitstringNoหน่วย: "วัน" หรือ "ชั่วโมง"
company_idstringNoID บริษัท (plain text)
company_namestringNoชื่อบริษัท
branch_idstringNoID สาขา (plain text)
branch_namestringNoชื่อสาขา
department_idstringYesID แผนก (plain text)
department_namestringYesชื่อแผนก
position_idstringNoID ตำแหน่ง (plain text)
position_namestringNoชื่อตำแหน่ง
createdstringNoวันเวลาที่สร้าง (YYYY-MM-DD HH:mm:ss)
updatedstringYesวันเวลาที่แก้ไขล่าสุด (YYYY-MM-DD HH:mm:ss)

Error Response

{ "code": 404, "message": "Quota not found", "payload": [] }

Code Examples

curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/salary/get-data-filter?path_action=get_quota_by_id&quota_id=MjAyNjAxMDFBQkMxMjM0NTY3ODk=&language_code=TH" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"

Notes

  • remaining คำนวณอัตโนมัติจาก time_leave_flag_quota - actual
  • ฟิลด์ที่ลงท้ายด้วย _en จะส่งมาเสมอไม่ว่า language_code จะเป็นอะไร
  • quota_id ที่ได้จาก response เป็น plain text ต้องแปลงเป็น Base64 ก่อนส่งกลับใน request

  • List Quotas - ดูรายการโควตาทั้งหมด (ค้นหา quota_id)
  • Get Quota by Employee - ดูโควตาทั้งหมดของพนักงานคนเดียว
  • Update Quota - แก้ไขจำนวนโควตา (ใช้ quota_id จาก API นี้)
  • Delete Quota - ลบโควตา (ใช้ quota_id จาก API นี้)
Last updated on