Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Get Manpower Summary by Branch

สรุปจำนวนพนักงานที่ไปปฏิบัติงานจริงในแต่ละสาขาแบบ Grid รายเดือน/สัปดาห์ (นับจำนวนต่อวันต่อสาขา)

ใช้ API นี้เพื่อดึงข้อมูลสรุปจำนวนพนักงานที่ไปปฏิบัติงานจริงแยกตามสาขาแบบรายวัน เหมาะสำหรับวิเคราะห์และจัดสรรกำลังพลในภาพรวมระดับสาขา — ต่างจาก Get Manpower Grid ที่ให้รายละเอียดระดับพนักงานแต่ละคน

Endpoint

POST /api/v1/open-apis/time-manage/get-sum-personnel-multiple-in-branch

สิทธิ์ที่ต้องการ: API Key ต้องมีสิทธิ์ ข้อมูลการยื่นเอกสาร (document:manage)

Request Parameters

Required Parameters (ระบุอย่างใดอย่างหนึ่ง)

ParameterTypeRequiredDescriptionExample
month_nostringConditionallyรอบเงินเดือน (YYYY-MM) — ห้ามส่งคู่กับ week_no"2026-07"
week_nostringConditionallyวันที่ใดๆ ในสัปดาห์ที่ต้องการ (YYYY-MM-DD) — ห้ามส่งคู่กับ month_no"2026-07-01"

Optional Parameters

ParameterTypeDefaultDescriptionExample
employee_codestringnullรหัสพนักงานกรณีเรียกรายคน (ระบบแปลงเป็น ID ให้อัตโนมัติ)"EMP001"
company_listsarray<{id}>[]รายการ ID บริษัทที่กรอง (Base64)[{ "id": "MjAyNTExMjdENDU3M0M0MjE2Mzk=" }]
branch_listsarray<{id}>[]รายการ ID สาขาที่กรอง (Base64)[{ "id": "MjAyNTExMjdENDU3M0M0MjE2Mzk=" }]
department_listsarray<{id}>[]รายการ ID แผนกที่กรอง (Base64)[]
division_listsarray<{id}>[]รายการ ID ฝ่ายที่กรอง (Base64)[]
section_listsarray<{id}>[]รายการ ID แผนกย่อยที่กรอง (Base64)[]
section_lists_lv01section_lists_lv05array<{id}>[]รายการ ID แผนกย่อยระดับ 1–5 (Base64)[]
position_listsarray<{id}>[]รายการ ID ตำแหน่งที่กรอง (Base64)[]
employee_listsarray<{id}>[]รายการ ID พนักงานโดยตรง (Base64)[{ "id": "MjAyNTExMjdENDU3M0M0MjE2Mzk=" }]
hashtagstring""ข้อความแฮชแท็กที่ใช้กรอง (คั่นแต่ละแท็กด้วยเว้นวรรค)"#IT #Developer"
round_month_configstring""ประเภทงวด: "" (ทั้งหมด), "Full" (เต็มเดือน), "Split" (แบ่งงวดจ่าย)"Full"
language_codestring"TH"ภาษาของข้อมูล: "TH" หรือ "EN""TH"

Endpoint นี้ไม่มีการแบ่งหน้า (pagination) — ไม่รองรับพารามิเตอร์ _PAGE / _NUMBER_PER_PAGE และ response จะไม่มี _PAGINATION เนื่องจากผลลัพธ์เป็นรายการสาขา ไม่ใช่รายชื่อพนักงาน

Request Body Example

{ "month_no": "2026-07", "language_code": "TH", "round_month_config": "Full", "branch_lists": [ { "id": "MjAyNTExMjdENDU3M0M0MjE2Mzk=" } ] }

Response Format

Success Response (HTTP 200)

{ "code": 200, "payload": { "time_range": { "start_date": "2026-06-26", "end_date": "2026-07-25", "day_range": 30 }, "child": [ { "detail": { "branch_code": "HQ", "branch_name": "สำนักงานใหญ่", "branch_id": "202412254358646B34E4", "total": "42" }, "daily": [ { "work_date": "2026-07-01", "count": 5 } ] } ] } }

Error Response - Validation Failed (HTTP 400)

{ "code": 400, "message": "ไม่สำเร็จ", "errors": [ "Please specify either 'month_no' (YYYY-MM) or 'week_no' (YYYY-MM-DD)" ] }

Error Response - Unauthorized (HTTP 401)

{ "statusCode": 401, "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription." }

Empty Result (HTTP 200)

หากไม่พบสาขาใดในช่วงเวลาที่ระบุ ระบบจะตอบกลับ HTTP 200 โดย payload.time_range เป็นค่าว่างและไม่มี child:

{ "code": 200, "message": "Success", "payload": { "time_range": { "start_date": "", "end_date": "", "day_range": 0 } } }

Response Fields

payload.time_range

FieldTypeNullableDescription
start_datestringNoวันเริ่มต้นช่วงเวลาค้นหา (YYYY-MM-DD)
end_datestringNoวันสิ้นสุดช่วงเวลาค้นหา (YYYY-MM-DD)
day_rangeintegerNoจำนวนวันทั้งหมดในช่วงเวลานี้

payload.child[].detail

FieldTypeNullableDescription
branch_codestringYesรหัสสาขา
branch_namestringYesชื่อสาขา (ภาษาตาม language_code)
branch_idstringNoรหัสอ้างอิงสาขา
totalstringNoจำนวนพนักงานทั้งหมดที่สังกัดสาขานี้ — ไม่ใช่ จำนวนที่ไปปฏิบัติงานจริง

payload.child[].daily[]

FieldTypeNullableDescription
work_datestringNoวันที่ (YYYY-MM-DD) ของรายการนี้
countintegerNoจำนวนพนักงานที่ไปปฏิบัติหน้าที่จริงในสาขานี้ ณ วันที่ดังกล่าว (0 หากไม่มีข้อมูลวันนั้น)

Code Examples

curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/time-manage/get-sum-personnel-multiple-in-branch" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "month_no": "2026-07", "language_code": "TH", "round_month_config": "Full", "branch_lists": [ { "id": "MjAyNTExMjdENDU3M0M0MjE2Mzk=" } ] }'

Validation Rules

ParameterValidation
month_no / week_noต้องส่งอย่างใดอย่างหนึ่ง และห้ามส่งพร้อมกัน
month_noต้องมีรูปแบบ YYYY-MM
week_noต้องมีรูปแบบ YYYY-MM-DD
round_month_configต้องเป็น "", "Full" หรือ "Split" เท่านั้น
hashtag / employee_codeต้องเป็นข้อมูลประเภท string

Business Rules

  • หากส่ง employee_code ระบบจะค้นหาเฉพาะพนักงานคนนั้น มิเช่นนั้นจะค้นตาม filter องค์กร (สาขา/แผนก/ตำแหน่ง ฯลฯ)
  • total คือจำนวนพนักงานทั้งหมดที่สังกัดสาขานั้น ส่วน count รายวันคือจำนวนที่ไปปฏิบัติงานจริงในวันนั้น จึงอาจไม่เท่ากัน
  • ทุกวันในช่วงเวลาที่ค้นหาจะมีรายการใน daily เสมอ — วันที่ไม่มีพนักงานปฏิบัติงานจะมี count เป็น 0
  • branch_name จะแสดงเป็นภาษาไทยหรือภาษาอังกฤษตามค่า language_code ที่ส่งเข้ามา
  • Get Manpower Grid - ดึงรายละเอียดสาขาปฏิบัติงานรายวันแยกรายพนักงาน (มีการแบ่งหน้า)
  • Get Work Cycle Grid - ดึงตารางกะการทำงานของพนักงานตามช่วงเวลา
Last updated on