Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Get Location List

ดึงรายการสถานที่บันทึกเวลาที่ลงทะเบียนในระบบ รองรับการกรองตามสถานะเผยแพร่และเรียงลำดับตามฟิลด์ต่างๆ

ใช้ API นี้เพื่อค้นหา location_id ที่ต้องใช้ประกอบกับ Submit Time Attendance สำหรับการบันทึกเวลาประเภท Checkin, QR และ Facial

Endpoint

GET /api/v1/open-apis/locations/get-list

Request Parameters

ParameterTypeRequiredDescription
publish_flagstringNoกรองตามสถานะเผยแพร่ — ค่าที่รองรับ: Y, N
sort_bystringNoเรียงลำดับผลลัพธ์ — ค่าที่รองรับ: 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

FieldTypeDescription
location_idstringรหัสสถานที่ในระบบ
location_group_codestringรหัสกลุ่มสถานที่
location_namestringชื่อสถานที่
location_latitudestringละติจูด
location_longitudestringลองจิจูด
location_radiusnumberรัศมีที่อนุญาตให้บันทึกเวลา (เมตร)
location_startstring|nullเวลาเริ่มต้นที่เปิดให้บันทึก
location_endstring|nullเวลาสิ้นสุดที่เปิดให้บันทึก
location_qrpathstringPath ของ QR Code สำหรับ Time Attendance App
Monnumberวันจันทร์เปิดใช้งาน (1 = เปิด, 0 = ปิด)
Tuenumberวันอังคารเปิดใช้งาน (1 = เปิด, 0 = ปิด)
Wednumberวันพุธเปิดใช้งาน (1 = เปิด, 0 = ปิด)
Thunumberวันพฤหัสบดีเปิดใช้งาน (1 = เปิด, 0 = ปิด)
Frinumberวันศุกร์เปิดใช้งาน (1 = เปิด, 0 = ปิด)
Satnumberวันเสาร์เปิดใช้งาน (1 = เปิด, 0 = ปิด)
Sunnumberวันอาทิตย์เปิดใช้งาน (1 = เปิด, 0 = ปิด)
publish_flagstringสถานะการเผยแพร่ (Y = เผยแพร่, N = ไม่เผยแพร่)
createdstring|nullวันเวลาที่ลงทะเบียนสถานที่ (YYYY-MM-DD HH:mm:ss)

Usage Examples

ดึงสถานที่ทั้งหมด

curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/locations/get-list" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"

ดึงเฉพาะสถานที่ที่เผยแพร่แล้ว พร้อมเรียงตามชื่อ

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

ParameterValidationError 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 มีหน่วยเป็นเมตร ใช้ตรวจสอบระยะที่พนักงานบันทึกเวลาได้จากตำแหน่งศูนย์กลาง
  • Submit Time Attendance - บันทึกเวลาโดยอ้างอิง location_id ที่ได้จาก API นี้
  • Get Device List - อุปกรณ์บันทึกเวลาที่ผูกกับสถานที่
Last updated on