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

Area

List

Request

  • Method: GET

  • Url: /personnel/api/areas/

  • 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
area_codeUse this field to query
area_nameUse this field to query
area_code_icontainsQuery the data that this field contains
area_name_icontainsQuery the data that this field contains
orderingid, area_code, area_name

Response

{
    "count": 27,
    "next": "null",
    "previous": null,
    "msg": "",
    "code": 0,
    "data": [
        {
            "id": 1,
            "area_code": "1",
            "area_name": "WORLD",
            "parent_area": null
        },
        {
            "id": 93,
            "area_code": "5190062",
            "area_name": "shenzhen",
            "parent_area": null
        },
        ...
        ...
}

Read

Request

  • Method: GET

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

  • Headers:

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

ParameterDescription
idrequired

Response

- **Url:** /personnel/api/areas/1/
{
    "id": 1,
    "area_code": "1",
    "area_name": "WORLD",
    "parent_area": null
}

Create

  • Method: POST
  • Url: /personnel/api/areas/
  • Headers:
    • Content-Type: application/json
    • Authorization: "JWT ey.........oQi98"
  • Request Body
{
    "area_code": "test area code",
    "area_name": "test area name",
    "parent_area": null
}
ParameterRequiredTypeDescription
area_codeYStringArea Code
area_nameYStringArea Name
parent_areaNIntegerParent Area

Response

{
    "id": 100,
    "area_code": "test area code",
    "area_name": "test area name",
    "parent_area": null
}

Update

Request

  • Method: PUT

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

  • Headers:

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

ParameterDescription
idrequired
  • Request Body
{
    "area_code": "11",
    "area_name": "test area name",
}
ParameterRequiredTypeDescription
area_codeYStringArea Code
area_nameYStringArea Name
parent_areaNIntegerParent Area

Response

- **Url:** PUT /personnel/api/areas/1/
{
    "id": 1,
    "area_code": "11",
    "area_name": "WORLD WORLD",
    "parent_area": null
}

Delete

Request

  • Method: DELETE

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

  • Headers:

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

ParameterDescription
idrequired

Response

None
Next
Department