Get Quota by ID
ดึงข้อมูลโควตาการลารายการเดียวตาม ID เพื่อดูรายละเอียดหรือเตรียมข้อมูลก่อนแก้ไข
Endpoint
GET /api/v1/open-apis/salary/get-data-filter?path_action=get_quota_by_idQuery Parameters
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
path_action | string | Yes | - | ต้องเป็น get_quota_by_id | "get_quota_by_id" |
quota_id | string | Yes | - | รหัสโควตา (Base64 encoded) | "MjAyNjAxMDFBQkMxMjM0NTY3ODk=" |
language_code | string | No | "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
| Field | Type | Nullable | Description |
|---|---|---|---|
quota_id | string | No | ID โควตา (plain text) |
employee_id | string | No | ID พนักงาน (plain text) |
employee_code | string | No | รหัสพนักงาน |
employee_name | string | No | ชื่อ (ตาม language_code) |
employee_last_name | string | No | นามสกุล (ตาม language_code) |
employee_nickname | string | Yes | ชื่อเล่น (ตาม language_code) |
employee_name_en | string | No | ชื่อ (EN) - ส่งมาเสมอ |
employee_last_name_en | string | No | นามสกุล (EN) - ส่งมาเสมอ |
employee_nickname_en | string | Yes | ชื่อเล่น (EN) |
quota_year | string | No | ปีโควตา (YYYY) |
time_leave_flag | string | No | รหัสประเภทการลา (01-09) |
time_leave_flag_name | string | No | ชื่อประเภทการลา (ไทย) |
time_leave_flag_name_en | string | No | ชื่อประเภทการลา (อังกฤษ) |
time_leave_flag_quota | string | No | จำนวนโควตาทั้งหมด (decimal) |
actual | number | No | จำนวนที่ใช้ไปแล้ว |
remaining | number | No | จำนวนคงเหลือ (quota - actual) |
unit | string | No | หน่วย: "วัน" หรือ "ชั่วโมง" |
company_id | string | No | ID บริษัท (plain text) |
company_name | string | No | ชื่อบริษัท |
branch_id | string | No | ID สาขา (plain text) |
branch_name | string | No | ชื่อสาขา |
department_id | string | Yes | ID แผนก (plain text) |
department_name | string | Yes | ชื่อแผนก |
position_id | string | No | ID ตำแหน่ง (plain text) |
position_name | string | No | ชื่อตำแหน่ง |
created | string | No | วันเวลาที่สร้าง (YYYY-MM-DD HH:mm:ss) |
updated | string | Yes | วันเวลาที่แก้ไขล่าสุด (YYYY-MM-DD HH:mm:ss) |
Error Response
{
"code": 404,
"message": "Quota not found",
"payload": []
}Code Examples
cURL
curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/salary/get-data-filter?path_action=get_quota_by_id"a_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
Related APIs
- List Quotas - ดูรายการโควตาทั้งหมด (ค้นหา quota_id)
- Get Quota by Employee - ดูโควตาทั้งหมดของพนักงานคนเดียว
- Update Quota - แก้ไขจำนวนโควตา (ใช้ quota_id จาก API นี้)
- Delete Quota - ลบโควตา (ใช้ quota_id จาก API นี้)
Last updated on