Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Get Device List

ดึงรายการอุปกรณ์บันทึกเวลาที่ลงทะเบียนในระบบ รองรับการกรองตามประเภทอุปกรณ์และเรียงลำดับตามฟิลด์ต่างๆ

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

Endpoint

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

Request Parameters

ParameterTypeRequiredDescription
device_typestringNoกรองตามประเภทอุปกรณ์ — ค่าที่รองรับ: Wifi, Beacon, TimeApp, Fingerprint, Facial
sort_bystringNoเรียงลำดับผลลัพธ์ — ค่าที่รองรับ: device_name (default), device_sn, device_type, device_id, created

Response Format

Success Response (HTTP 200)

{ "code": "200", "message": "Success", "payload": [ { "device_id": "202602135BE4EB20778E", "device_sn": "202602135BE4EB20778E", "device_name": "Time App Test", "device_type": "TimeApp", "device_model": "", "device_latitude": "13.7563", "device_longitude": "100.5018", "device_last_activity": "2026-02-13 14:10:00", "publish_flag": "Y", "created": "2026-02-10 09:00:00" } ] }

Error Response (HTTP 400)

Validation Error

{ "code": "400", "message": "Failed", "errors": [ "'device_type' must be one of: Wifi, Beacon, TimeApp, Fingerprint, Facial" ] }

Exception Error

{ "code": "400", "message": "Failed", "error": "Error message here" }

Response Fields

FieldTypeDescription
device_idstringรหัสอุปกรณ์ในระบบ
device_snstringSerial number ของอุปกรณ์
device_namestringชื่ออุปกรณ์
device_typestringประเภทอุปกรณ์ (Wifi, Beacon, TimeApp, Fingerprint, Facial)
device_modelstringรุ่นอุปกรณ์
device_latitudestringละติจูดของอุปกรณ์
device_longitudestringลองจิจูดของอุปกรณ์
device_last_activitystring|nullวันเวลาที่อุปกรณ์ใช้งานล่าสุด (YYYY-MM-DD HH:mm:ss)
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/devices/get-list" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"

กรองเฉพาะอุปกรณ์ Wifi พร้อมเรียงตาม Serial Number

curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/devices/get-list?device_type=Wifi&sort_by=device_sn" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"

Validation Rules

ParameterValidationError Message
device_typeต้องเป็นค่าใดค่าหนึ่ง: Wifi, Beacon, TimeApp, Fingerprint, Facial'device_type' must be one of: Wifi, Beacon, TimeApp, Fingerprint, Facial
sort_byต้องเป็นค่าใดค่าหนึ่ง: device_name, device_sn, device_type, device_id, created'sort_by' must be one of: device_name, device_sn, device_type, device_id, created

Notes

  • ถ้าไม่ระบุ sort_by จะเรียงตาม device_name เป็นค่า default
  • ถ้าไม่มีข้อมูล payload จะเป็น array ว่าง []
  • ฟิลด์ device_last_activity และ created อาจเป็น null ถ้าอุปกรณ์ยังไม่เคยใช้งาน
  • Submit Time Attendance - บันทึกเวลาโดยอ้างอิง device_sn และ device_name ที่ได้จาก API นี้
Last updated on