Department Lists Retrieval (Recursively)API Explorer

Introduction

API Introduction

Department Lists Retrieval API (Recursively) enables you to retrieve all sub-departments of a specified department ID (recursively).

API Version

API Version

Updated Time

Version Description

V1

2022.10.28

The API request frequency is increased from five times/second to ten times/second. The parameter "dept_no" is moved to the request body, and the API route is changed to POST corp/department/user/list.

V2

2023.08.01

A new response parameter called "seq" has been added to the department entity structure. This parameter allows for sorting departments within their parent department.

API Calling

The API enables you to retrieve all sub-departments of a specified department ID (recursively).

Request URL: https://api.jodoo.com/api/v5/corp/department/list

Request Frequency: 10 times/second

Request Method: POST

Request Parameters:

Parameter

Required

Type

Description

dept_no

Yes

Number

Department number

has_child

No

Boolean

The system is set not to recursively obtain all sub-departments. That is, you can only obtain the immediate departments.

Sample Request:

Retrieve a list of all departments recursively under the root department of the current enterprise. Note: The number 1 is the department ID for the root department.

{
  "dept_no": 1,
  "has_child": true
}

Responses:

Parameter

Type

Description

departments

Array

The list of sub-departments under the currently specified department

Sample Response:

{
  "departments": [
    {
      "dept_no": 3,
      "name": "Finance department",
      "parent_no": 1,
      "type": 0,
      "status": 1
    },
    {
      "dept_no": 33,
      "name": "Sales Department",
      "parent_no": 3,
      "type": 0,
      "status": 1
      "seq": 2
    }
  ]
}

Was this information helpful?
Yes
NoNo
Need more help? Contact support