API docsAPI docs
  • English
  • zh-CN
  • English
  • zh-CN
    • Overview
    • Request & Response
    • Get Auth Token
    • Use Auth Token
    • Api Example
    • Area
    • Department
    • Position
    • Employee
    • Resign
    • Device
    • Transaction
    • Transaction Report

Employee

List

Request

  • Method: GET
  • Url: /personnel/api/employees/
  • Headers:
    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Query Parameters
ParameterDescription
pageWhich page is displayed
page_sizeShow the number of data on this page
emp_codeUse this field to query
emp_code_icontainsQuery the data that this field contains
first_nameUse this field to query
first_name_icontainsQuery the data that this field contains
last_nameUse this field to query
last_name_icontainsQuery the data that this field contains
departmentUse this field to query
areasUse this field to query

Response

{
    "count": 6,
    "next": null,
    "previous": null,
    "msg": "",
    "code": 0,
    "data": [
        {
            "id": 1,
            "emp_code": "007",
            "first_name": "",
            "last_name": null,
            "nickname": null,
            "device_password": null,
            "card_no": null,
            "department": {
                "id": 3715,
                "dept_code": "4",
                "dept_name": "MARS Egypt"
            },
            "position": null,
            "hire_date": "2020-06-01",
            "gender": null,
            "birthday": null,
            "verify_mode": 0,
            "emp_type": null,
            "contact_tel": null,
            "office_tel": null,
            "mobile": null,
            "national": null,
            "city": null,
            "address": null,
            "postcode": null,
            "email": null,
            "enroll_sn": "CEUY201760002",
            "ssn": null,
            "religion": null,
            "enable_att": true,
            "enable_overtime": false,
            "enable_holiday": true,
            "dev_privilege": 0,
            "area": [
                {
                    "id": 136,
                    "area_code": "1111.111.11",
                    "area_name": "test1"
                }
            ],
            "app_status": 0,
            "app_role": 1,
            "update_time": "2020-06-01 19:37:35",
            "fingerprint": "Ver 10:1",
            "face": "-",
            "palm": "-",
            "vl_face": "-"
        },
        ......
    ]
}

Read

Request

  • Method: GET

  • Url: /personnel/api/employees/{id}/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Path Parameters

ParameterDescription
idrequired

Response

  • Url: /personnel/api/employees/1/
{
    "id": 1,
    "emp_code": "007",
    "first_name": "",
    "last_name": null,
    "nickname": null,
    "device_password": null,
    "card_no": null,
    "department": {
        "id": 3715,
        "dept_code": "4",
        "dept_name": "MARS Egypt"
    },
    "position": null,
    "hire_date": "2020-06-01",
    "gender": null,
    "birthday": null,
    "verify_mode": 0,
    "emp_type": null,
    "contact_tel": null,
    "office_tel": null,
    "mobile": null,
    "national": null,
    "city": null,
    "address": null,
    "postcode": null,
    "email": null,
    "enroll_sn": "CEUY201760002",
    "ssn": null,
    "religion": null,
    "enable_att": true,
    "enable_overtime": false,
    "enable_holiday": true,
    "dev_privilege": 0,
    "area": [
        {
            "id": 136,
            "area_code": "1111.111.11",
            "area_name": "test1"
        }
    ],
    "app_status": 0,
    "app_role": 1,
    "update_time": "2020-06-01 19:37:35",
    "fingerprint": "Ver 10:1",
    "face": "-",
    "palm": "-",
    "vl_face": "-"
}

Create

  • Method: POST
  • Url: /personnel/api/employees/
  • Headers:
    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body
{
    "emp_code": "111111111",
    "department": 1,
    "area": [1, 2]
}
ParameterRequiredTypeDescription
emp_codeYStringEmployee Code
departmentYIntegerdepartment id, example: [1, 2, 3, ...]
areaYListarea id
hire_dateNStringformat: yyyy-mm-dd, default today
first_nameNStringmax length:25 char
last_nameNStringmax length:25 char
genderNStringS, F, M
mobileNStringmax length:20 char
nationalNStringmax length:50 char
addressNStringmax length:200 char
emailNStringmax length:50 char, input right format
app_statusNInteger(1, 'Enable');(0, 'Disable')
...NString
...NString

Response

{
    "id": 100,
    "emp_code": "111111111",
    "first_name": "",
    "last_name": null,
    "nickname": null,
    "device_password": null,
    "card_no": null,
    "department": {
        "id": 1,
        "dept_code": "default dept",
        "dept_name": "default dept"
    },
    "position": null,
    "hire_date": "2020-06-01",
    "gender": null,
    "birthday": null,
    "verify_mode": 0,
    "emp_type": null,
    "contact_tel": null,
    "office_tel": null,
    "mobile": null,
    "national": null,
    "city": null,
    "address": null,
    "postcode": null,
    "email": null,
    "enroll_sn": "",
    "ssn": null,
    "religion": null,
    "enable_att": true,
    "enable_overtime": false,
    "enable_holiday": true,
    "dev_privilege": 0,
    "area": [
        {
            "id": 1,
            "area_code": "default dept",
            "area_name": "default dept"
        },
        {
            "id": 2,
            "area_code": "default dept1",
            "area_name": "default dept1"
        }
    ],
    "app_status": 0,
    "app_role": 1,
    "update_time": "2020-06-01 19:37:35",
    "fingerprint": -,
    "face": "-",
    "palm": "-",
    "vl_face": "-"
}

Update

Request

  • Method: PUT

  • Url: /personnel/api/employees/{id}/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Path Parameters

ParameterDescription
idrequired
  • Request Body
{
    "emp_code": "111111111",
    "department": 1,
    "area": [1, 2]
}
ParameterRequiredTypeDescription
emp_codeYStringEmployee Code
departmentYIntegerdepartment id, example: [1, 2, 3, ...]
areaYListarea id
hire_dateNStringformat: yyyy-mm-dd, default today
first_nameNStringmax length:25 char
last_nameNStringmax length:25 char
genderNStringS, F, M
mobileNStringmax length:20 char
nationalNStringmax length:50 char
addressNStringmax length:200 char
emailNStringmax length:50 char, input right format
app_statusNInteger(1, 'Enable');(0, 'Disable')
...NString
...NString

Response

{
    "id": 100,
    "emp_code": "111111111",
    "first_name": "",
    "last_name": null,
    "nickname": null,
    "device_password": null,
    "card_no": null,
    "department": {
        "id": 1,
        "dept_code": "default dept",
        "dept_name": "default dept"
    },
    "position": null,
    "hire_date": "2020-06-01",
    "gender": null,
    "birthday": null,
    "verify_mode": 0,
    "emp_type": null,
    "contact_tel": null,
    "office_tel": null,
    "mobile": null,
    "national": null,
    "city": null,
    "address": null,
    "postcode": null,
    "email": null,
    "enroll_sn": "",
    "ssn": null,
    "religion": null,
    "enable_att": true,
    "enable_overtime": false,
    "enable_holiday": true,
    "dev_privilege": 0,
    "area": [
        {
            "id": 1,
            "area_code": "default dept",
            "area_name": "default dept"
        },
        {
            "id": 2,
            "area_code": "default dept1",
            "area_name": "default dept1"
        }
    ],
    "app_status": 0,
    "app_role": 1,
    "update_time": "2020-06-01 19:37:35",
    "fingerprint": -,
    "face": "-",
    "palm": "-",
    "vl_face": "-"
}

Delete

Request

  • Method: DELETE

  • Url: /personnel/api/employees/{id}/

  • Headers:

    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Path Parameters

ParameterDescription
idrequired

Response

None

Adjust area

Request

  • Method: POST

  • Url: /personnel/api/employees/adjust_area/

  • Headers:

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

{
    "employees": [1, 2],
    "areas": [3, 4]
}
ParameterRequiredTypeDescription
employeesYListemployee id list example: [1, 2, 3, ...]
areasYListarea id list, example: [1, 2, 3, ...]

Adjust department

Request

  • Method: POST

  • Url: /personnel/api/employees/adjust_department/

  • Headers:

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

{
    "employees": [1, 2],
    "department": 2
}
ParameterRequiredTypeDescription
employeesYListemployee id list example: [1, 2, 3, ...]
departmentYIntegerdepartment id

Adjust regsin

Request

  • Method: POST

  • Url: /personnel/api/employees/adjust_regsin/

  • Headers:

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

{
    "employees": [1, 2],
    "resign_date": 2,
    "resign_type": 1,
    "reason": "test reason",
    "disableatt": True
}
ParameterRequiredTypeDescription
employeesYListemployee id list example: [1, 2, 3, ...]
resign_dateYStringformat: yyyy-mm-dd
resign_typeYInteger(1, quit), (2, dismissed), (3, resign), (4, transfer), (5, retainJobWithoutSalary),
reasonNStringmax length:200 char
disableattYBooltrue, false

Del bio template

Request

  • Method: POST

  • Url: /personnel/api/employees/del_bio_template/

  • Headers:

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

{
    "employees": [1, 2],
    "finger_print": true,
    "face": false,
    "finger_vein": true,
    "palm": true
}
ParameterRequiredTypeDescription
employeesYListemployee id list example: [1, 2, 3, ...]
finger_printNBooltrue, false
faceNBooltrue, false
finger_veinNBooltrue, false
palmNBooltrue, false

Resync to device

Request

  • Method: POST

  • Url: /personnel/api/employees/resync_to_device/

  • Headers:

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

{
    "employees": [1, 2]
}
ParameterRequiredTypeDescription
employeesYListemployee id list example: [1, 2, 3, ...]
Prev
Position
Next
Resign