# 设备API
# 列表
# 请求
- Method: GET
- Url: /iclock/api/terminals/
- Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
- Query Parameters
参数 | 描述 |
---|---|
page | |
page_size | |
sn | |
alias | |
state | |
area | |
sn_icontains | |
alias_icontains |
# 响应
{
"count": 6,
"next": null,
"previous": null,
"msg": "",
"code": 0,
"data": [
{
"id": 5,
"sn": "A6KX192060002",
"ip_address": "172.30.7.162",
"alias": "Auto add",
"terminal_name": null,
"fw_ver": null,
"push_ver": null,
"state": 1,
"terminal_tz": 8,
"area": {
"id": 1,
"area_code": "1",
"area_name": "Not Authorized"
},
"last_activity": "2020-06-02 15:04:38",
"user_count": null,
"fp_count": null,
"face_count": null,
"palm_count": null,
"transaction_count": null,
"push_time": null,
"transfer_time": "00:00;14:05",
"transfer_interval": 1,
"is_attendance": 1,
"area_name": "Not Authorized"
},
......
]
}
# 读取
# 请求
Method: GET
Url: /iclock/api/terminals/{id}/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Path Parameters
参数 | 描述 |
---|---|
id | 必填 |
# 响应
- Url: /iclock/api/terminals/5/
{
"id": 5,
"sn": "A6KX192060002",
"ip_address": "172.30.7.162",
"alias": "Auto add",
"terminal_name": null,
"fw_ver": null,
"push_ver": null,
"state": 1,
"terminal_tz": 8,
"area": {
"id": 1,
"area_code": "1",
"area_name": "Not Authorized"
},
"last_activity": "2020-06-02 15:04:38",
"user_count": null,
"fp_count": null,
"face_count": null,
"palm_count": null,
"transaction_count": null,
"push_time": null,
"transfer_time": "00:00;14:05",
"transfer_interval": 1,
"is_attendance": 1,
"area_name": "Not Authorized"
}
# 创建
- Method: POST
- Url: /iclock/api/terminals/
- Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
- Request Body
{
"sn": "111111111",
"alias": "test device",
"ip_address": "127.0.0.1",
"terminal_tz": 8,
"heartbeat": 10,
"area": 1
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
sn | Y | String | 设备编号 |
alias | Y | String | 设备名称 |
ip_address | Y | String | 设备IP地址 |
terminal_tz | N | Integer | |
heartbeat | N | Integer | |
area | N | Integer | |
... | N | String | |
... | N | String |
# 响应
{
"id": 9,
"sn": "111111111",
"ip_address": "127.0.0.1",
"alias": "test device",
"terminal_name": null,
"fw_ver": null,
"push_ver": null,
"state": 1,
"terminal_tz": 8,
"area": {
"id": 1,
"area_code": "1",
"area_name": "Not Authorized"
},
"last_activity": "2020-06-02 15:04:38",
"user_count": null,
"fp_count": null,
"face_count": null,
"palm_count": null,
"transaction_count": null,
"push_time": null,
"transfer_time": "00:00;14:05",
"transfer_interval": 1,
"is_attendance": 1,
"area_name": "Not Authorized"
}
# 更新
# 请求
Method: PUT
Url: /iclock/api/terminals/{id}/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Path Parameters
参数 | 描述 |
---|---|
id | 必填 |
- Request Body
{
"sn": "111111111",
"alias": "test device",
"ip_address": "127.0.0.1",
"terminal_tz": 8,
"heartbeat": 10,
"area": 1
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
sn | Y | String | 设备编号 |
alias | Y | String | 设备名称 |
ip_address | Y | String | 设备IP地址 |
terminal_tz | N | Integer | |
heartbeat | N | Integer | |
area | N | Integer | |
... | N | String | |
... | N | String |
# 删除
# 请求
Method: DELETE
Url: /iclock/api/terminals/{id}/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Path Parameters
参数 | 描述 |
---|---|
id | 必填 |
# 响应
None
# 清除命令
# 请求
Method: POST
Url: /iclock/api/terminals/clear_command/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Request Body
{
"terminals": [1]
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
terminals | Y | List | 设备编号列表, 示例: [1, 2, 3, ...] |
# 清除照片
# 请求
Method: POST
Url: /iclock/api/terminals/clear_capture/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Request Body
{
"terminals": [1]
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
terminals | Y | List | 设备编号列表, 示例: [1, 2, 3, ...] |
# 清除所有数据
# 请求
Method: POST
Url: /iclock/api/terminals/clear_all/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Request Body
{
"terminals": [1]
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
terminals | Y | List | 设备编号列表, 示例: [1, 2, 3, ...] |
# 上传所有数据
# 请求
Method: POST
Url: /iclock/api/terminals/upload_all/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Request Body
{
"terminals": [1]
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
terminals | Y | List | 设备编号列表, 示例: [1, 2, 3, ...] |
# 上传考勤数据
# 请求
Method: POST
Url: /iclock/api/terminals/upload_transaction/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Request Body
{
"terminals": [1]
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
terminals | Y | List | 设备编号列表, 示例: [1, 2, 3, ...] |
# 重启
# 请求
Method: POST
Url: /iclock/api/terminals/reboot/
Headers:
- Content-Type: application/json
- Authorization: "JWT ey.........oQi98"
Request Body
{
"terminals": [1]
}
参数 | 必填 | 类型 | 描述 |
---|---|---|---|
terminals | Y | List | 设备编号列表, 示例: [1, 2, 3, ...] |