Get Location List
ดึงรายการสถานที่บันทึกเวลาที่ลงทะเบียนในระบบ รองรับการกรองตามสถานะเผยแพร่และเรียงลำดับตามฟิลด์ต่างๆ
ใช้ API นี้เพื่อค้นหา location_id ที่ต้องใช้ประกอบกับ Submit Time Attendance สำหรับการบันทึกเวลาประเภท Checkin, QR และ Facial
Endpoint
GET /api/v1/open-apis/locations/get-listRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
publish_flag | string | No | กรองตามสถานะเผยแพร่ — ค่าที่รองรับ: Y, N |
sort_by | string | No | เรียงลำดับผลลัพธ์ — ค่าที่รองรับ: order_no (default), location_name, location_id, location_group_code, created |
Response Format
Success Response (HTTP 200)
{
"code": "200",
"message": "Success",
"payload": [
{
"location_id": "20260212D9F611580550",
"location_group_code": "LOC001",
"location_name": "อาคาร A",
"location_latitude": "13.7563",
"location_longitude": "100.5018",
"location_radius": 100,
"location_start": null,
"location_end": null,
"location_qrpath": "",
"Mon": 1,
"Tue": 1,
"Wed": 1,
"Thu": 1,
"Fri": 1,
"Sat": 0,
"Sun": 0,
"publish_flag": "Y",
"created": "2026-02-10 09:00:00"
}
]
}Error Response (HTTP 400)
Validation Error
{
"code": "400",
"message": "Failed",
"errors": [
"'publish_flag' must be one of: Y, N"
]
}Exception Error
{
"code": "400",
"message": "Failed",
"error": "Error message here"
}Response Fields
| Field | Type | Description |
|---|---|---|
location_id | string | รหัสสถานที่ในระบบ |
location_group_code | string | รหัสกลุ่มสถานที่ |
location_name | string | ชื่อสถานที่ |
location_latitude | string | ละติจูด |
location_longitude | string | ลองจิจูด |
location_radius | number | รัศมีที่อนุญาตให้บันทึกเวลา (เมตร) |
location_start | string|null | เวลาเริ่มต้นที่เปิดให้บันทึก |
location_end | string|null | เวลาสิ้นสุดที่เปิดให้บันทึก |
location_qrpath | string | Path ของ QR Code สำหรับ Time Attendance App |
Mon | number | วันจันทร์เปิดใช้งาน (1 = เปิด, 0 = ปิด) |
Tue | number | วันอังคารเปิดใช้งาน (1 = เปิด, 0 = ปิด) |
Wed | number | วันพุธเปิดใช้งาน (1 = เปิด, 0 = ปิด) |
Thu | number | วันพฤหัสบดีเปิดใช้งาน (1 = เปิด, 0 = ปิด) |
Fri | number | วันศุกร์เปิดใช้งาน (1 = เปิด, 0 = ปิด) |
Sat | number | วันเสาร์เปิดใช้งาน (1 = เปิด, 0 = ปิด) |
Sun | number | วันอาทิตย์เปิดใช้งาน (1 = เปิด, 0 = ปิด) |
publish_flag | string | สถานะการเผยแพร่ (Y = เผยแพร่, N = ไม่เผยแพร่) |
created | string|null | วันเวลาที่ลงทะเบียนสถานที่ (YYYY-MM-DD HH:mm:ss) |
Usage Examples
ดึงสถานที่ทั้งหมด
cURL
curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/locations/get-list" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"ดึงเฉพาะสถานที่ที่เผยแพร่แล้ว พร้อมเรียงตามชื่อ
cURL (GET)
curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/locations/get-list?publish_flag=Y&sort_by=location_name" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Validation Rules
| Parameter | Validation | Error Message |
|---|---|---|
publish_flag | ต้องเป็น Y หรือ N | 'publish_flag' must be one of: Y, N |
sort_by | ต้องเป็นค่าใดค่าหนึ่ง: location_name, location_id, location_group_code, created, order_no | 'sort_by' must be one of: location_name, location_id, location_group_code, created, order_no |
Notes
- ถ้าไม่ระบุ
sort_byจะเรียงตามorder_noเป็นค่า default - ถ้าไม่มีข้อมูล payload จะเป็น array ว่าง
[] - ฟิลด์
location_start,location_endและcreatedอาจเป็นnullถ้ายังไม่ได้กำหนดค่า location_radiusมีหน่วยเป็นเมตร ใช้ตรวจสอบระยะที่พนักงานบันทึกเวลาได้จากตำแหน่งศูนย์กลาง
Related APIs
- Submit Time Attendance - บันทึกเวลาโดยอ้างอิง
location_idที่ได้จาก API นี้ - Get Device List - อุปกรณ์บันทึกเวลาที่ผูกกับสถานที่
Last updated on