API docsAPI docs
  • English
  • zh-CN
  • English
  • zh-CN
    • 概述
    • 请求 & 响应
    • 获取Auth Token
    • 使用 Auth Token
    • Api Example
    • 区域API
    • 部门API
    • 职位API
    • 人员API
    • 离职API
    • 设备API
    • 考勤记录API
    • 考勤报表API

设备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| 一共有54个选项 | |heartbeat|N|Integer| 默认值为10 | |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| 一共有54个选项 | |heartbeat|N|Integer| 默认值为10 | |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]
}
参数必填类型描述
terminalsYList设备编号列表, 示例: [1, 2, 3, ...]

清除照片

请求

  • Method: POST

  • Url: /iclock/api/terminals/clear_capture/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body

{
    "terminals": [1]
}
参数必填类型描述
terminalsYList设备编号列表, 示例: [1, 2, 3, ...]

清除所有数据

请求

  • Method: POST

  • Url: /iclock/api/terminals/clear_all/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body

{
    "terminals": [1]
}
参数必填类型描述
terminalsYList设备编号列表, 示例: [1, 2, 3, ...]

上传所有数据

请求

  • Method: POST

  • Url: /iclock/api/terminals/upload_all/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body

{
    "terminals": [1]
}
参数必填类型描述
terminalsYList设备编号列表, 示例: [1, 2, 3, ...]

上传考勤数据

请求

  • Method: POST

  • Url: /iclock/api/terminals/upload_transaction/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body

{
    "terminals": [1]
}
参数必填类型描述
terminalsYList设备编号列表, 示例: [1, 2, 3, ...]

重启

请求

  • Method: POST

  • Url: /iclock/api/terminals/reboot/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body

{
    "terminals": [1]
}
参数必填类型描述
terminalsYList设备编号列表, 示例: [1, 2, 3, ...]
Next
考勤记录API