Get Device List
ดึงรายการอุปกรณ์บันทึกเวลาที่ลงทะเบียนในระบบ รองรับการกรองตามประเภทอุปกรณ์และเรียงลำดับตามฟิลด์ต่างๆ
ใช้ API นี้เพื่อค้นหา device_sn และ device_name ที่ต้องใช้ประกอบกับ Submit Time Attendance สำหรับการบันทึกเวลาประเภท Wifi, Beacon และ QR
Endpoint
GET /api/v1/open-apis/devices/get-listRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
device_type | string | No | กรองตามประเภทอุปกรณ์ — ค่าที่รองรับ: Wifi, Beacon, TimeApp, Fingerprint, Facial |
sort_by | string | No | เรียงลำดับผลลัพธ์ — ค่าที่รองรับ: 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
| Field | Type | Description |
|---|---|---|
device_id | string | รหัสอุปกรณ์ในระบบ |
device_sn | string | Serial number ของอุปกรณ์ |
device_name | string | ชื่ออุปกรณ์ |
device_type | string | ประเภทอุปกรณ์ (Wifi, Beacon, TimeApp, Fingerprint, Facial) |
device_model | string | รุ่นอุปกรณ์ |
device_latitude | string | ละติจูดของอุปกรณ์ |
device_longitude | string | ลองจิจูดของอุปกรณ์ |
device_last_activity | string|null | วันเวลาที่อุปกรณ์ใช้งานล่าสุด (YYYY-MM-DD HH:mm:ss) |
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/devices/get-list" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"กรองเฉพาะอุปกรณ์ Wifi พร้อมเรียงตาม Serial Number
cURL (GET)
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
| Parameter | Validation | Error 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ถ้าอุปกรณ์ยังไม่เคยใช้งาน
Related APIs
- Submit Time Attendance - บันทึกเวลาโดยอ้างอิง
device_snและdevice_nameที่ได้จาก API นี้
Last updated on